Basic Linux commands - II

Basic Linux commands - II

What is the Linux command to

  1. Cat
    The cat command is used to view what's written in a file.

  2. chmod

    The command name "chmod" stands for "change mode." It restricts the way a file can be accessed.
    To change the access permissions of files

  3. history

    The history command in Linux is a built-in shell tool that displays a list of commands used in the terminal session. history allows users to reuse any listed command without retyping it.
    To check which commands you have run till now.

  4. To remove a directory/ Folder.

    • to remove the file rm<filename>

    • to remove the directory rmdir <directory_name>

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

    the vim text editor is used to create and edit files and the cat command is used to view the content of the file.

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

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

    head -3 devops.txt is used to print down the first 3 lines from a file.

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

    tail -3 devops.txt is used to print down the first 3 lines from a file including space.

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

    touch <filename> is used to create a new file.

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

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

    diff command is used to list the difference between two files.

Thanks for reading! I hope you understood these concepts and learned something.

If you have any queries, feel free to reach out to me on LinkedIn.

Did you find this article valuable?

Support Ritik Gupta Blog's by becoming a sponsor. Any amount is appreciated!