๐ŸŒŸ Day 3 - Basics of Linux Commands ๐Ÿ–ฅ๏ธ๐Ÿ‘ฉโ€๐Ÿ’ป

๐ŸŒŸ Day 3 - Basics of Linux Commands ๐Ÿ–ฅ๏ธ๐Ÿ‘ฉโ€๐Ÿ’ป

ยท

3 min read

Joining the #90DaysOfDevOps challenge ๐Ÿš€ under the guidance of Shubham Londhe Sir, alongside the #TrainWithShubham community! ๐ŸŒโœจ

Day 3 TASK :

๐ŸงLinux commands:

15 Basic Linux Commands Every User Should Know๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ป | Cloudzy

  1. To view what's written in a file:

    Command:cat

    Syntax:cat rhythm.txt

    Explanation: This command displays the full contents of the specified file directly in the terminal window. To view the contents of a file, you can use the cat command

    2. To change the access permissions of files:

    Command:chmod

    Syntax:chmod [options] permissions filename

    Explanation: Modifies the read, write, and execute permissions for a file or directory. The chmod command is used to change the access permissions of files.

    3. To check which commands you have run till now:

    Command:history

    Syntax:history

    Explanation: Lists a chronological record of the commands executed in the current terminal session. To check the commands you have run so far, the history command is your go-to tool

    4. To remove a directory/Folder:

    Command:rmdir

    Syntax:rmdir directory_name or rm -rf directory_name

    Explanation: Deletes an empty directory. To remove a directory with its contents, usermdir directory_name or rm -rf directory_name (use with caution!). The rmdir or rm command can be used to remove a directory. Be cautious with rm as it can delete files and directories permanently.

    5. To create a fruits.txt file and to view the content:

    Commands:

    • touch fruits.txt (creates the file)

    • cat fruits.txt (views the content)

      Explanation: To create a new file, you can use the touch command.To view the content, you can use the cat command

    6. Add content in fruits.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava:

    Command:echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > fruits.txt

    7. To Show only the top three fruits from the file:

    Command:head devops.txt -n 3

    8. To Show only the bottom three fruits from the file:

    Command:tail devops.txt -n 2

    9. To create another file Colors.txt and to view the content:

    Commands:

    • touch Colors.txt (creates the file)

    • cat Colors.txt (views the content)

    10. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey:

    Command:echo -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txt

    11. To find the difference between fruits.txt and Colors.txt file:

    Command:diff fruits.txt Colors.txt

    Explanation:

    • This command compares the contents offruits.txt with Colors.txt.

    • It outputs the differences between the files in a line-by-line format.

    Happy Learning :) ๐Ÿš€๐ŸŒŸ


    Thank you for taking the time to read this blog. I hope you found valuable insights! If you enjoyed the content, please consider giving it a like, sharing it, and following for more insightful posts in the future. Your support means a lot! Looking forward to sharing more knowledge with you! ๐Ÿš€

    ๐Ÿ™ŒA special thanks to Shubham Londhe #TrainWithShubham and the DevOps community for organizing this fantastic initiative. Let's learn, grow, and make a difference through DevOps!

    Let's Connect..!

    ๐ŸŒLinkedIn

    ๐ŸŒTwitter

    ๐ŸŒGitHub

    :)Happy Learning...

    Thank you for reading! ๐Ÿ’š

    -RhythmDevOpsBlogs๐Ÿ’

ย