Boost Your DevOps Skill: Linux Commands

Boost Your DevOps Skill: Linux Commands

DevOps 90-Days Challenge, Day-03

Introduction -

A computer or software can be instructed on what actions to undertake through the use of commands, which can vary greatly in complexity and purpose. The system or program being utilized can have a big impact on the syntax and specific commands that are used.

  1. touch - a command to generate an empty file.

    as an illustration of creating multiple files - touch stock {1..10}

  2. cat - to view the contents in the file

    For example - To create a fruits.txt file and to view the content

    cat -b: This adds line numbers to non-blank lines

    cat -n: This adds line numbers to all lines

    cat -s: This squeezes blank lines into one line

    cat -e: This shows $ at the end of the line

  3. head and tail - The head command displays content from the top of the file, and the tail command displays content from the bottom of the file.

    For example - To Show only top three fruits from the file.To Show only bottom three fruits from the file.

  4. vi / vim - For quickly editing files from the command line without requiring a graphical user interface.

    For Example - To create another file Colors.txt and to view the content.

  5. diff - The diff command in Linux is used to compare the contents of two text files and display the differences between them. It's a powerful utility for identifying changes, additions, and deletions in text files.

    For Example - To find the difference between fruits.txt and Colors.txt file.

  6. sudo: This command executes only that command with superuser privileges.

  7. chmod - You can change a file's read, write, and execute permissions with the chmod command. You have the option of using a symbolic or numeric mode to set the permissions.

    For Example - To change the access permissions of files.

  8. history - The history command will display a list of the commands you've recently executed in the terminal, along with line numbers.

    conclusion -

    These commands are fundamental building blocks for handling system configurations, automating processes, and guaranteeing the stability and security of our environments. These fundamental abilities will provide a solid foundation for more complex and specialized DevOps operations.