Advertisement
0x2264773426

Common Linux commands:

Apr 7th, 2023 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. Common Linux commands:
  2.  
  3. * Use ("/quotation mark) before and after filename or directory name if there space is added *
  4.  
  5. To make a directory:
  6. mkdir (Stands for make directory)
  7. e.g.: mkdir [DIRECTORY_NAME]
  8.  
  9. To change or navigate the directory:
  10. cd (Stands for change directory)
  11. e.g.: cd [DIRECTORY_NAME]
  12.  
  13. To go back to the previous directory:
  14. cd..
  15.  
  16. To list the content of the current directory:
  17. ls (Stands for list)
  18.  
  19. To list the content of the current directory (In detail):
  20. ls -l
  21.  
  22. To rename a file or a directory:
  23. rename [OLD_FILENAME.FILETYPE_EXTENSION] [NEW_FILENAME.FILETYPE_EXTENSION]
  24.  
  25. To remove a file or a directory:
  26. rm (Stands for remove)
  27. e.g.: rm [FILENAME_OR_DIRECTORY_NAME]
  28.  
  29. To present or open any text type or text-contained file:
  30. cat [FILENAME.FILETYPE_EXTENSION_OR_PATH]
  31.  
  32. To edit or open any text type or text-contained file:
  33. nano [FILENAME.FILETYPE_EXTENSION_OR_PATH]
  34.  
  35. Some nano commands:
  36. 1) CTRL+O (For saving/writing out)
  37. 2) Enter key (To save the filename with their filetype extension)
  38. 3) CTRL+X (To exit)
  39.  
  40. To copy any file or directory:
  41. cp (Stands for copy)
  42. e.g.: cp [FILENAME.FILETYPE_EXTENSION_OR_WITH_OLD_PATH] [NEW_PATH_OR_DESTINATION]
  43.  
  44. To move/cut any file or directory:
  45. mv (Stands for move)
  46. e.g.: mv [FILENAME.FILETYPE_EXTENSION_OR_WITH_OLD_PATH] [NEW_PATH_OR_DESTINATION]
  47.  
  48. To see entire directories as tree:
  49. cd /
  50. tree
  51.  
  52. To clear the terminal screen:
  53. clear
  54.  
  55. To exit or exit from the root/admin user mode:
  56. exit
  57.  
  58. To enter into the root/admin user mode:
  59. sudo su
  60. Then enter the password if there is
  61.  
  62. To present current date:
  63. date
  64.  
  65. To present current time:
  66. time
  67.  
  68. To execute any program file:
  69. ./[FILENAME.FILETYPE_EXTENSION_OR_PATH]
  70.  
  71. To change password in Linux:
  72. sudo passwd
  73. 1) Enter your old password and press enter
  74. 2) Type a new password and press enter (minimum 8 letters or 8 numbers or 8 special characters or a sequence of that characters are allowed)
  75. 3) Retype new password and press enter
  76. 4) Then reboot your system to make changes everywhere
  77.  
  78. To reboot system:
  79. reboot
  80.  
  81. To shutdown:
  82. poweroff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement