Basic Linux Commands

Basic Linux Commands

Table Of Contents
1. To view what's written in a file.
2. To change the access permissions of files.
3. To check which commands you have run till now.
4. To remove a directory/ Folder.
5. To create a devops.txt file and view the content.
6. Add content in fruit.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
7. Show only the top three fruits from the file.
8. Show only the bottom three fruits from the file.
9. To create another file Colors.txt and to view the content.
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 the fruits.txt and Colors.txt files.

Linux is a free and open-source operating system based on the Unix kernel. It is widely used in servers, supercomputers, mobile devices, and embedded systems. Linux distributions come in various flavors, such as Ubuntu, Fedora, etc.

What is the Linux command to

  1. To view what's written in a file

    cat: The "cat" command in Linux is short for "concatenate," and it is used to display the contents of a file in the terminal window. It can also be used to create, copy, and concatenate files.

  2. To change the access permissions of files.

    chmod: The "chmod" command in Linux is used to change the permissions of files or directories. It stands for "change mode" and it is a command-line utility that allows you to specify who can read, write, or execute a file or directory.

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

    history: The "history" command in Linux is used to display a list of previously executed commands in the terminal. It is a convenient way to review and reuse commands that you have used before.

  4. To remove a directory/ Folder.

    rmdir: The "rmdir" command in Linux is used to remove an empty directory. It stands for "remove directory" and it is a command-line utility that allows you to delete directories that do not contain any files or subdirectories.

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

    touch: The "touch" command in Linux is used to create a new file or update the access and modification timestamps of an existing file. It is a simple command-line utility that is often used to create empty files or update the timestamp of a file.

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

    echo: The "echo" command in Linux is used to display text on the terminal. It is a simple command-line utility that allows you to print messages or variables to the screen.

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

    head: The "head" command in Linux is used to display the first few lines of a file. It is a command-line utility that allows you to quickly view the beginning of a file without opening it in a text editor.

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

    tail: The "tail" command in Linux is used to display the last few lines of a file. It is a command-line utility that allows you to quickly view the end of a file without opening it in a text editor.

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

    touch: The "touch" command in Linux is used to create a new file or update the access and modification timestamps of an existing file. It is a simple command-line utility that is often used to create empty files or update the timestamp of a file.

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

    echo: The "echo" command in Linux is used to display text on the terminal. It is a simple command-line utility that allows you to print messages or variables to the screen.

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

    diff: The "diff" command in Linux is used to compare the contents of two files and display the differences between them. It is a command-line utility that is commonly used by programmers and system administrators to identify changes made to files, such as configuration files, scripts, or source code.

In conclusion, Linux commands are powerful tools that allow users to perform a wide range of tasks from the command line interface. There are numerous command-line utilities available in Linux that enable you to perform a wide variety of tasks, ranging from simple file management to complex system administration tasks.

Thanks For Reading!

#devops#90DaysOfdevOps#TrainWithShubham

Let's connect on LinkedIn - linkedin.com/in/namya-khullar-7b5758200