Basic Linux commands

  1. ls - Lists the files and directories in the current directory.

  2. cd - Changes the current directory. For example, cd /var/www would change the current directory to /var/www.

  3. mkdir - Creates a new directory. For example, mkdir DevOps would create a new directory named "DevOps".

  4. rm - Deletes files and directories. For example, rm myfile.txt would delete the file "myfile.txt".

  5. rmdir - Deletes a directory. For example, rmdir DevOps would delete the directory "DevOps".

  6. cp - Copies a file from one location to another. For example, cp file1.txt /home/user/ would copy the file "file1.txt" to the directory /home/user/.

  7. mv - Moves or renames a file. For example, mv file1.txt /home/user/newfile.txt would move the file "file1.txt" to the directory /home/user/ and rename it to "newfile.txt".

  8. cat - Displays the contents of a file. For example, cat file1.txt would display the contents of the file "file1.txt".

9. grep - Searches for a specific string in a file. For example, grep "hello" file1.txt would search for the string "hello" in the file "file1.txt".

These are just a few of the many commands available in Linux.

Day-2 Task

  1. Check your present working directory.
pwd
  1. List all the files or directories including hidden files.

  2.     ls -a
    

    3. Create a nested directory A/B/C/D/E

    1.         mkdir -p  A/B/C/D/E