Tips:
1, command completion function: <Tab> key
2, clear screen: ctrl+l
3. Delete all contents before cursor: ctrl+u
4. Command history: Historical
Then:! The command label listed in history, you can execute that command.
Such as:! 188
Also: Press the arrow keys ↑ and ↓ to find previously executed commands.
Key Tips:
1. Command aliases:
Role: Can make the operation easier, commands can be more easily remembered.
Alias: Displays the aliases that have been defined by the system.
Define aliases:
Alias COPY=CP
Alias drm= "RM-RF" #定义别名组合, must be caused by ""
To delete an alias :
Unalias copy
Attached-many times,systems in UNIX systems do not have these aliases set up!
2. Input/Output redirection:
0 (STDIN)-standard input, keyboard ;
1 (STDOUT)-standard output, display ;
2 (STDERR)-standard error output, monitor.
> or >> output redirection
LS-L/tmp > Test.txt//File Original contents empty
LS-L/tmp >> test.txt//Append
< input redirection
Wall < Test.txt//input redirect
2> Error Output redirection
Cp-r/usr/backup/usr.bak 2>/bak.error
3, Pipeline: The output of one command is passed to another command as input to another command.
Ls-l/etc | More
Ls-l/etc | grep init #grep Init/etc/inittab
Ls-l/etc | grep init | Wc-l #wc command is a counter
4. Command connector
1); #用; Each command in the interval is executed sequentially
PWD, ls;d ate
2)&&
Command1 && Command2
Successful execution
Failure does not execute
#前后命令的执行存在逻辑与关系, only the command after && has been successfully executed before it is executed.
e.g.
Write Mary
LS && pwd
LSKKK && pwd
3)| |
Command1 | | Command2
Execution does not execute
Do not perform execution
#前后命令的执行存在逻辑或关系, only | | After the previous command execution fails , the command after it is executed.
e.g.
Write Mary
ls | | Pwd
LSKKK | | Pwd
Linux Common Commands (second Edition)--shell application tips