Advertisement
xGHOSTSECx

105 Basic Linux CLI Commands

Dec 30th, 2023
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.94 KB | None | 0 0
  1.  
  2. 1. **`ls`**: List files and directories.
  3. - Example: `ls -l` for detailed listing.
  4.  
  5. 2. **`cd`**: Change directory.
  6. - Example: `cd Documents` to navigate.
  7.  
  8. 3. **`pwd`**: Print current working directory.
  9.  
  10. 4. **`mkdir`**: Create a new directory.
  11. - Example: `mkdir NewDirectory`.
  12.  
  13. 5. **`touch`**: Create an empty file.
  14. - Example: `touch newfile.txt`.
  15.  
  16. 6. **`cp`**: Copy files or directories.
  17. - Example: `cp file.txt /path/to/destination`.
  18.  
  19. 7. **`mv`**: Move or rename files/directories.
  20. - Example: `mv oldfile.txt newfile.txt`.
  21.  
  22. 8. **`rm`**: Remove/delete files or directories.
  23. - Caution: `rm file.txt`.
  24.  
  25. 9. **`cat`**: Display file contents.
  26. - Example: `cat file.txt`.
  27.  
  28. 10. **`nano` or `vim`**: Text editors for file editing.
  29. - Example: `nano filename`.
  30.  
  31. 11. **`grep`**: Search for a pattern in files.
  32. - Example: `grep pattern file.txt`.
  33.  
  34. 12. **`chmod`**: Change file permissions.
  35. - Example: `chmod 755 file.txt`.
  36.  
  37. 13. **`chown`**: Change file ownership.
  38. - Example: `chown user:group file.txt`.
  39.  
  40. 14. **`alias`**: Create a shortcut for a command.
  41. - Example: `alias ll='ls -l'`.
  42.  
  43. 15. **`find`**: Search for files.
  44. - Example: `find /path -name filename`.
  45.  
  46. 16. **`awk`**: Process and analyze text.
  47. - Example: `awk '{print $1}' file.txt`.
  48.  
  49. 17. **`sed`**: Text stream editor.
  50. - Example: `sed 's/old/new/g' file.txt`.
  51.  
  52. 18. **`history`**: View command history.
  53. - Example: `history | tail -n 10`.
  54.  
  55. 19. **`shutdown`**: Power off or restart.
  56. - Example: `shutdown now`.
  57.  
  58. 20. **`df`**: Display disk space usage.
  59. - Example: `df -h`.
  60.  
  61. 21. **`du`**: Display file and directory space usage.
  62. - Example: `du -sh directory`.
  63.  
  64. 22. **`tar`**: Create or extract compressed archives.
  65. - Example: `tar -cvf archive.tar files`.
  66.  
  67. 23. **`wget`**: Download files from the internet.
  68. - Example: `wget url`.
  69.  
  70. 24. **`scp`**: Securely copy files between systems.
  71. - Example: `scp file.txt user@remote:/path`.
  72.  
  73. 25. **`head`**: Display the first lines of a file.
  74. - Example: `head -n 5 file.txt`.
  75.  
  76. 26. **`tail`**: Display the last lines of a file.
  77. - Example: `tail -n 10 file.txt`.
  78.  
  79. 27. **`nmcli`**: Command-line client for NetworkManager.
  80. - Example: `nmcli device show`.
  81.  
  82. 28. **`ps`**: Display information about running processes.
  83. - Example: `ps aux`.
  84.  
  85. 29. **`kill`**: Terminate a process.
  86. - Example: `kill process_id`.
  87.  
  88. 30. **`uname`**: Display system information.
  89. - Example: `uname -a`.
  90.  
  91. 31. **`date`**: Display the current date and time.
  92. - Example: `date`.
  93.  
  94. 32. **`echo`**: Display a message.
  95. - Example: `echo "Hello, World!"`.
  96.  
  97. 33. **`whoami`**: Display the current username.
  98. - Example: `whoami`.
  99.  
  100. 34. **`top`**: Display real-time system statistics.
  101. - Press `q` to exit.
  102.  
  103. 35. **`ifconfig` or `ip`**: Display network interface information.
  104. - Example: `ifconfig` or `ip address show`.
  105. ```
  106.  
  107. And here are the remaining commands:
  108.  
  109. ```markdown
  110. 36. **`ping`**: Check network connectivity to a host.
  111. - Example: `ping google.com`.
  112.  
  113. 37. **`nc`**: Netcat for network communication.
  114. - Example: `nc -zv host 80` checks connectivity on a specific port.
  115.  
  116. 38. **`df`**: Display disk space usage.
  117. - Example: `df -h`.
  118.  
  119. 39. **`du`**: Display file and directory space usage.
  120. - Example: `du -sh directory`.
  121.  
  122. 40. **`free`**: Display system memory usage.
  123. - Example: `free -h`.
  124.  
  125. 41. **`ps`**: Display information about running processes.
  126. - Example: `ps aux`.
  127.  
  128. 42. **`kill`**: Terminate a process.
  129. - Example: `kill process_id`.
  130.  
  131. 43. **`uname`**: Display system information.
  132. - Example: `uname -a`.
  133.  
  134. 44. **`date`**: Display the current date and time.
  135. - Example: `date`.
  136.  
  137. 45. **`echo`**: Display a message.
  138. - Example: `echo "Hello, World!"`.
  139.  
  140. 46. **`whoami`**: Display the current username.
  141. - Example: `whoami`.
  142.  
  143. 47. **`top`**: Display real-time system statistics.
  144. - Press `q` to exit.
  145.  
  146. 48. **`ifconfig` or `ip`**: Display network interface information.
  147. - Example: `ifconfig` or `ip address show`.
  148.  
  149. 49. **`ping`**: Check network connectivity to a host.
  150. - Example: `ping google.com`.
  151.  
  152. 50. **`nc`**: Netcat for network communication.
  153. - Example: `nc -zv host 80` checks connectivity on a specific port.
  154.  
  155. 51. **`uptime`**: Display how long the system has been running.
  156. - Example: `uptime`.
  157.  
  158. 52. **`groups`**: Show the groups a user belongs to.
  159. - Example: `groups username`.
  160.  
  161. 53. **`passwd`**: Change user password.
  162. - Example: `passwd`.
  163.  
  164. 54. **`ps`**: Display information about running processes.
  165. - Example: `ps aux`.
  166.  
  167. 55. **`kill`**: Terminate a process.
  168. - Example: `kill process_id`.
  169.  
  170. 56. **`uname`**: Display system information.
  171. - Example: `uname -a`.
  172.  
  173. 57. **`date`**: Display the current date and time.
  174. - Example: `date`.
  175.  
  176. 58. **`echo`**: Display a message.
  177. - Example: `echo "Hello, World!"`.
  178.  
  179. 59. **`whoami`**: Display the current username.
  180. - Example: `whoami`.
  181.  
  182. 60. **`top`**: Display real-time system statistics.
  183. - Press `q` to exit.
  184.  
  185. 61. **`ifconfig` or `ip`**: Display network interface information.
  186. - Example: `ifconfig` or `ip address show`.
  187.  
  188. 62. **`ping`**: Check network connectivity to a host.
  189. - Example: `ping google.com`.
  190.  
  191. 63. **`nc`**: Netcat for network communication.
  192. - Example: `nc -zv host 80` checks connectivity on a specific port.
  193.  
  194. 64. **`df`**: Display disk space usage.
  195. - Example: `df -h`.
  196.  
  197. 65. **`du`**: Display file and directory space usage.
  198. - Example: `du -sh directory`.
  199.  
  200. 66. **`free`**: Display system memory usage.
  201. - Example: `free -h`.
  202.  
  203. 67. **`ps`**: Display information about running processes.
  204. - Example: `ps aux`.
  205.  
  206. 68. **`kill`**: Terminate a process.
  207. - Example: `kill process_id`.
  208.  
  209. 69. **`uname`**: Display system information.
  210. - Example: `uname -a`.
  211.  
  212. 70. **`date`**: Display the current date and time.
  213. - Example: `date`.
  214.  
  215. 71. **`echo`**: Display a message.
  216. - Example: `echo "Hello, World!"`.
  217.  
  218. 72. **`whoami`**: Display the current username.
  219. - Example: `whoami`.
  220.  
  221. 73. **`top`**: Display real-time system statistics.
  222. - Press `q` to exit.
  223.  
  224. 74. **`ifconfig` or `ip`**: Display network interface information.
  225. - Example: `ifconfig` or `ip address show`.
  226.  
  227. 75. **`ping`**: Check network connectivity to a host.
  228. - Example: `ping google.com`.
  229.  
  230. 76. **`nc`**: Netcat for network communication.
  231. - Example: `nc -zv host 80` checks connectivity on a specific port.
  232.  
  233. 77. **`df`**: Display disk space usage.
  234. - Example: `df -h`.
  235.  
  236. 78. **`du`**: Display file and directory space usage.
  237. - Example: `du -sh directory`.
  238.  
  239. 79. **`free`**: Display system memory usage.
  240. - Example: `free -h`.
  241.  
  242. 80. **`ps`**: Display information about running processes.
  243. - Example: `ps aux`.
  244.  
  245. 81. **`kill`**: Terminate a process.
  246. - Example: `kill process_id`.
  247.  
  248. 82. **`uname`**: Display system information.
  249. - Example: `uname -a`.
  250.  
  251. 83. **`date`**: Display the current date and time.
  252. - Example: `date`.
  253.  
  254. 84. **`echo`**: Display a message.
  255. - Example: `echo "Hello, World!"`.
  256.  
  257. 85. **`whoami`**: Display the current username.
  258. - Example: `whoami`.
  259.  
  260. 86. **`top`**: Display real-time system statistics.
  261. - Press `q` to exit.
  262.  
  263. 87. **`ifconfig` or `ip`**: Display network interface information.
  264. - Example: `ifconfig` or `ip address show`.
  265.  
  266. 88. **`ping`**: Check network connectivity to a host.
  267. - Example: `ping google.com`.
  268.  
  269. 89. **`nc`**: Netcat for network communication.
  270. - Example: `nc -zv host 80` checks connectivity on a specific port.
  271.  
  272. 90. **`uptime`**: Display how long the system has been running.
  273. - Example: `uptime`.
  274.  
  275. 91. **`groups`**: Show the groups a user belongs to.
  276. - Example: `groups username`.
  277.  
  278. 92. **`passwd`**: Change user password.
  279. - Example: `passwd`.
  280.  
  281. 93. **`ps`**: Display information about running processes.
  282. - Example: `ps aux`.
  283.  
  284. 94. **`kill`**: Terminate a process.
  285. - Example: `kill process_id`.
  286.  
  287. 95. **`uname`**: Display system information.
  288. - Example: `uname -a`.
  289.  
  290. 96. **`date`**: Display the current date and time.
  291. - Example: `date`.
  292.  
  293. 97. **`echo`**: Display a message.
  294. - Example: `echo "Hello, World!"`.
  295.  
  296. 98. **`whoami`**: Display the current username.
  297. - Example: `whoami`.
  298.  
  299. 99. **`top`**: Display real-time system statistics.
  300. - Press `q` to exit.
  301.  
  302. 100. **`ifconfig` or `ip`**: Display network interface information.
  303. - Example: `ifconfig` or `ip address show`.
  304.  
  305. 101. **`ping`**: Check network connectivity to a host.
  306. - Example: `ping google.com`.
  307.  
  308. 102. **`nc`**: Netcat for network communication.
  309. - Example: `nc -zv host 80` checks connectivity on a specific port.
  310.  
  311. 103. **`df`**: Display disk space usage.
  312. - Example: `df -h`.
  313.  
  314. 104. **`du`**: Display file and directory space usage.
  315. - Example: `du -sh directory`.
  316.  
  317. 105. **`free`**: Display system memory usage.
  318. - Example: `free -h`.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement