Linux shell 2 ----- Common commands linux shell ----- 1 variable $ #, $ @, $0, $1, $2 meaning explanation http://www.bkjia.com/ OS /201304/205497.html 1 ,! $ Is a special environment variable, which represents the last string of the previous command. For example, you may change $ mkdir mydir $ mv mydir yourdir $ cd yourdir to $ mkdir mydir $ mv! $ Yourdir $ cd! $2. cd-Return to the last directory. Scenario example: the current directory is/home/a. Use cd ../B to switch to/home/B. In this case, you can execute the cd-command repeatedly to switch back and forth between/home/a and/home/B. 3. du-sh * | sort-n | tail lists the top 10 files in the current directory. 4. ps aux | sort-nk + 4 | tail lists the top 10 processes with the most memory consumption. 5. netstat-tlnp lists the port numbers listened by local processes. 6. history | awk '{CMD [$2] ++; count ++;} END {for (a in CMD) print CMD [a] "" CMD [a]/count * 100 "%" a} '| grep-v ". /"| column-c3-s" "-t | sort-nr | nl | head-n10 can output the ten most commonly used commands, in this way, you can even find out what type of programmer you are. 7. When you are about to end the Login Dialog process, you can type the logout command, exit command, or file terminator (EOF) (press ctrl + d ), end logon 8, Ctrl + a switch to the command line start Ctrl + l clear the screen content, the effect is equivalent to clear Ctrl + y paste the character Ctrl + e just deleted switch to the end of the command line Ctrl + u clear cut the content before the cursor Ctrl + k cut clear the content after the cursor