๐Ÿ“ Basic Linux Commands ๐Ÿง

ยท

3 min read

๐Ÿ“ Basic Linux Commands ๐Ÿง

Table of contents

No heading

No headings in the article.

Welcome back to our DevOps journey! Today, we'll explore some basic Linux commands that are essential for every DevOps engineer. ๐Ÿš€

Let's dive in and discover these commands with a touch of fun and excitement! ๐ŸŽ‰

1๏ธโƒฃ Viewing File Content ๐Ÿ‘€

To satisfy your curiosity and view what's written in a file, you can use the cat command. It's like peeking into a treasure chest! ๐Ÿ’Ž

Example:

$cat myfile.txt

2๏ธโƒฃ Changing Access Permissions ๐Ÿ”’

Do you want to be the master of your files? Use the chmod command to change the access permissions and take control! ๐Ÿ”

Example:

$chmod 755 myfile.sh

3๏ธโƒฃ Checking Command History โณ

Ever wondered how many commands you've conquered on your DevOps journey? The history command reveals your past triumphs! โš”๏ธ

Example:

$history

4๏ธโƒฃ Removing a Directory ๐Ÿ—‚๏ธ

When it's time to bid farewell to a directory or folder, the rm command comes to the rescue! ๐Ÿšซ

Example:

$rm -r mydirectory

5๏ธโƒฃ Creating and Viewing a File ๐Ÿ“„

To create a file full of fruity goodness, use the touch command, like planting a seed. Then, use cat to view the vibrant content of the file! ๐ŸŽ๐ŸŒ๐Ÿ’

Example:

touch fruits.txt
cat fruits.txt

6๏ธโƒฃ Adding Content to a File ๐Ÿ–‹๏ธ

Get your virtual paintbrush ready! Use the echo command followed by the redirection symbol (>>) to add colorful fruits to the "devops.txt" file. Each fruit on a new line, like a painter's strokes! ๐ŸŽจ

Example:

$echo "Apple" >> devops.txt
$echo "Mango" >> devops.txt
$echo "Banana" >> devops.txt

7๏ธโƒฃ Showing Top Three Fruits ๐Ÿฅ‡๐Ÿฅˆ๐Ÿฅ‰

To pick the cream of the crop, use the head command with the -n option and specify 3. It's like awarding medals to the top three fruits! ๐Ÿ…

Example:

$head -n 3 devops.txt

8๏ธโƒฃ Showing Bottom Three Fruits ๐Ÿฅญ๐ŸŠ๐Ÿ‡

Now, let's give some love to the underdogs! The tail command with the -n option and 3 as the argument shows the bottom three fruits, like hidden gems waiting to be discovered! ๐Ÿ’Ž

Example:

$tail -n 3 devops.txt

9๏ธโƒฃ Creating and Viewing Another File ๐ŸŒˆ

Time to unleash your creativity! Use the touch command again to create the "Colors.txt" file. Then, use cat to view the enchanting colors written inside. It's like stepping into a vibrant rainbow! ๐ŸŒˆ

Example:

$touch Colors.txt
$cat Colors.txt

๐Ÿ”Ÿ Finding the Difference ๐Ÿ”„

To spot the dissimilarities between our fruity and colorful files, employ the diff command. It unveils the unique aspects, like playing spot-the-difference between two pictures! ๐Ÿ•ต๏ธโ€โ™‚๏ธ

Example:

$diff fruits.txt Colors.txt

And there you have it! These basic Linux commands have become your trusty companions on this DevOps adventure. ๐ŸŒŸ

Keep exploring, stay curious, and be amazed at the wonders of the Linux command line! ๐Ÿ’ก

Remember to share your progress on LinkedIn and let's continue this amazing journey together. Feel free to connect with me and share your experiences. ๐Ÿ˜Š

Happy command-line adventures! ๐Ÿš€๐Ÿง

Hope you like my blog...!

if u like the content follow me on LinkedIn: https://www.linkedin.com/in/ashok-sana

Follow my Whatsapp & telegram community: https://chat.whatsapp.com/BzX1aruZIH645l29LxvgO3

https://t.me/ExplorewithAshok

Happy learning......!

Did you find this article valuable?

Support Ashoksana by becoming a sponsor. Any amount is appreciated!

ย