1.history Save History Command 1000, history-c empty;
2.! String calls the most recently used command,! Vim's most recently used vim,! N calls the last Ming ' l,!242 that begins with N to invoke the No. 242 command in history.
3.alias Rename, alias h5= ' Head-5 ', unalias h5 cancel renaming.
4.| pipe break, connect multiple commands, redirect output from one command to another PS aux|grep MySQL, or ifconfig eth0|grep ' inet addr ' filter packets containing IP addresses, echo "Pass" | passwd--stdin Tom sets the user's Tom password to pass
5.> and >> output redirection,> overwrite,>> append. ls > list.txt Save the LS output to List.txt,hostname >> list.txt append host name to List.txt, ll ABC Install.log 2> Error.txt only redirect error output to Error.txt, ll ABC install.log>>all.txt 2>&1 append standard output 1 and Error output 2 to All.txt
6.shortcut key Ctrl + A moves the cursor to the beginning of the line,ctrl+e move to Behavior,Ctrl +F Move one right,Ctrl +b Move one left, Ctrl +l Clear Screen, Ctrl +u delete the cursor to the beginning of the character,Ctrl +K Delete the cursor to the end of the line character, Ctrl +c terminates the process,Ctrl +Z hangs the process, tops can view,Ctrl +W Delete the previous word (separated by a space) of the cursor,Ctrl +D Delete one word after the other
7. Command sequence using:& to open the child shell, so that running in the background, Firefox & will open the front of the program background execution, tops view, FG 1 back to the foreground execution;
& Make foreground program, suspend to backstage, CTRL + Z make program pause and suspend to backstage. FG 1 is recalled to reception.
&& multiple command combinations executed, but must be executed successfully before the next command, make && make Install,ls test.txt && cat test.txt;
|| Multiple command combinations, but the previous command must not execute successfully before the next, id Tom &>/dev/null &&echo "Hi, Tom" | | echo "No such user", mask the ID output via &> redirect, then && and | | Judge the display language. --20150615
Shell Learning 1