Linux basic commands

Linux basic commands

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

  2. pwd - Show present working directory.

  3. cd - Changes the current directory. For example, cd ubuntu/ would change the current directory to cd ubuntu/.

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

  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/ubuntu/dir1 would copy the file "file1.txt" to the directory /home/ubuntu/dir1/.

  7. mv - Moves or renames a file. For example, mv file1.txt /home/ubuntu/dir1/newfile.txt would move the file "file1.txt" to the directory /home/ubuntu/dir1 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".