Master Essential Linux Commands for DevOps Engineers

Master Essential Linux Commands for DevOps Engineers

ยท

3 min read

Here are the top 40 Linux commands used by DevOps engineers, categorized from beginner to advanced:

๐Ÿš€ Beginner Level:

  1. ls - List files and directories.

  2. cd - Change directory.

  3. pwd - Print the current working directory.

  4. mkdir - Create a new directory.

  5. rm - Remove files and directories.

  6. cp - Copy files and directories.

  7. mv - Move or rename files and directories.

  8. touch - Create an empty file.

  9. cat - View the contents of a file.

  10. grep - Search for patterns in files.

  11. chmod - Change file permissions.

  12. chown - Change file ownership.

  13. tar - Create or extract tar archives.

  14. find - Search for files and directories.

  15. top - Monitor system processes.

๐Ÿš€ Intermediate Level:

  1. ssh - Connect to remote servers securely.

  2. scp - Securely copy files between local and remote systems.

  3. rsync - Synchronize files and directories between systems.

  4. curl - Transfer data to or from a network server.

  5. wget - Download files from the web.

  6. sed - Stream editor for text manipulation.

  7. awk - Text processing and pattern matching.

  8. diff - Compare files line by line.

  9. git - Version control system.

  10. svn - Subversion version control system.

  11. tar - Compress and extract files.

  12. gzip - Compress files using gzip algorithm.

  13. unzip - Extract files from ZIP archives.

  14. crontab - Schedule periodic tasks.

  15. systemctl - Control system services.

๐Ÿš€ Advanced Level:

  1. iptables - Configure firewall rules.

  2. netstat - Network statistics and connections.

  3. ping - Send ICMP echo requests to a network host.

  4. ifconfig - Configure network interfaces.

  5. route - View and manipulate the IP routing table.

  6. dig - DNS lookup utility.

  7. nc - Network utility for reading/writing to network connections.

  8. lsof - List open files and associated processes.

  9. strace - Trace system calls and signals.

  10. docker - Containerization platform for building, deploying, and managing applications.

These commands cover a wide range of tasks and are commonly used by DevOps engineers in their day-to-day activities.

๐Ÿค– Exercise for Fun

Task: What is the Linux command to

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

     cat file_name
     Ex: cat file.txt
    

  2. To change the access permissions of files.

     chmod permission file_name
     Ex- chmod 777 file.txt
    

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

     history
    

  4. To remove a directory/ Folder.

     rm -r directoy/folder
     Ex: rm -r deamon
    

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

     vim file_name    # create file with contents
     cat file_name    # view content of file
     Ex: vim fruits.txt
         cat fruits.txt
    

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

     echo -e "text\n" >> file_name
     Ex: echo -e "Cherry\nKiwi\nOrange\nGuvava" >> fruits.txt
    

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

     head -n lines file_name
     Ex: head -n 3 fruits.txt
    

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

     tail -n lines file_name
     Ex: tail -n 3 fruits.txt
    

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

     vim file_name    # create file with contents
     cat file_name    # view content of file
     Ex: vim colors.txt
         cat colors.txt
    

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

    echo -e "text\n" >> file_name
    Ex: echo -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" >> colors.txt
    

  11. To find the difference between fruits.txt and Colors.txt files.

    diff file1 file2
    Ex: diff fruits.txt colors.txt
    

ย