导语
Linux中有许多常用的命令,这些命令往往是其操作对应的英文单词或短语简写,因此只要知道命令的英文全称,即可轻易记住这些命令。
高频命令
- pwd -- [print working directory] 显示当前工作目录。
- ls -- [list] 显示当前工作目录的内容。
-
cd -- [change directory] 切换工作目录。
$ cd ~
切换到home directory,$ cd ..
返回上级目录。 - mkdir -- [make directory] 创建目录。如果在目录名的前面没有加任何路径名,则在当前目录下创建由dirname指定的目录;如果给出了一个已经存在的路径,将会在该目录下创建一个指定的目录。
- rmdir -- [remove directory] 删除空目录。注意:子目录被删除之前应该是空目录。就是说,该目录中的所有文件必须用rm命令全部,另外,当前工作目录必须在被删除目录之上,不能是被删除目录本身,也不能是被删除目录的子目录。
- rm -- [remove] 删除一个目录中的一个或多个文件或目录,也可以将某个目录及其下属的所有文件及其子目录均删除掉。
- touch -- [touch]
- man -- [manual] --help
- cp -- [copy]
- mv -- [move]
- locate -- [locate]
中频命令
- echo -- [echo]
- cat -- [concatenate]
- sudo -- [Super User Do]
- du -- [disk usage]
- tar -- [tape archive]
- zip/unzip -- [zip/unzip]
- uname -- [unix name]
- apt -- [Advanced Package Tool]
- apt-get -- []
- apt-cache -- [] apt-cache search xxx*/apt-cache policy xxx
- chmod -- [change mode] chmod 467 (owner group public)
- chown -- [change owner]
- grep -- [globally search for regular expression and print out]
进程相关命令
- top -- [top was never an abbreviation] This utility tells the user about all the running processes on the Linux machine. / produces an ordered list of running processes selected by user-specified criteria, and updates it periodically. Default ordering by CPU usage, and only the top CPU consumers shown (hence the name).
- ps -- [Process Status]
- kill -- [kill]
- df -- [disk free]
- free -- [free] Gives free RAM on your system
Tips
- clear -- clear the terminal if it gets filled up with too many commands
- history -- shows all the commands that you have used in the past for the current terminal session
- TAB -- fill up in terminal
- Ctrl+C -- stop any command in terminal safely
- Ctrl+Z -- force to stop it
- exit -- exit from the terminal
- sudo halt -- power off
- sudo reboot -- reboot
dkpg -i (Debian Package)