Menu

Basic And Intermediate Commands For Linux

  1. pwd: To know which directory you are, you can use this command
  2. ls: List all the files in the directory
  3. cd: To go to a particular directory. Eg. cd directory_name
  4. mkdir: To make a directory or folder
  5. rmdir: To delete an empty directory
  6. rm: Used to delete files and directories. rm command deletes both files and directories
  7. rm-r: To delete just the directory
  8. touch: touch command is used to create a directory. touch filename.txt
  9. man: It shows the manual pages of the command. man command can be used to know more about the command and how to use it.eg., man cd
  10. cp: To copy files through command line
    • ls directory_name
    • cp file_name directory_name
    • ls directory_name
  11. locate: This command is used for locating a file in a directory or folder
  12. echo: echo is used to move data especially transfer text data to a file. eg., echo hello, my name is tex >> new_file.txt
  13. cat: the cat is used to display the contents of the file. Eg., cat display.txt
  14. vi and nano: vi and nano are installed text editors in the Linux command line. nano denotes keywords with color.you can create a new file using nano. If you want to create a new file using nano, just type nano new_file.txt.
  15. sudo: sudo stands for super user do. If you want to do anything with root privileges, you can use sudo command. For set a root password you can use the command 'su'
  16. df: df command is used to see available disk space in each partition
  17. df -m: df -m command is used for showing disk available space in megabytes
  18. du: du command is used for disk usage of a file in your system.
  19. tar: tar command is used with tarballs. That means a file compressed using tarball archive
    It can be used for compress and uncompress tar achieves (types include .tar, .tar.gz, etc.)
  20. zip: Zip to compress files into a zip archive.
  21. unzip: Extract files from a unzip archive.
  22. uname: Information about the system running. In includes release date of the kernel, version, processor type, etc.