One: Shell introduction
The shell is a command interpreter that provides interaction between the user and the machine, supports specific syntax, and each user can have his or her own specific shell,centos default of bash, and Zsh,ksh.
Two: Command history
History command
environment variable histsize, in/etc/profle, you can set the modified environment variable value, modify the maximum number of saved. You need to change the source a bit.
Time to save the history command:
histtimeformat= "%y/%m/%d%h:%m:%s"
Historical commands Save up to 1000 in the. bash_history file in the home directory, and commands that run in the current shell are saved to the file only if the user exits the current shell normally.
Daily usage:
- !! Executes the previous command
- !n executing the nth instruction in the command history
- ! The string executes the last instruction that begins with the string: command completion and aliases
tab, tap the Fill command or path, and double-click to display multiple options.
Alias command:
Give a long command a good name. Can be dismissed with the Unalias command.
Syntax: alias aliases = ' Specific commands '
Each user's custom alias is configured in the. bashrc file in the home directory
Four: wildcard characters, input and output redirectionWildcard characters:
* Match 0 or more characters
? Match one character
> Output redirection
>> Chasing heavier orientation
< input redirection
2> Error Redirection
2>> Error Append redirect
# comment Symbols
\ de-ideographic characters
| Pipe character, the result of running the previous command as input to the following command (text is manipulated)
$ for the identifier preceding the variable
The delimiter between multiple commands, regardless of whether the former succeeds or not, executes the latter
&& only if the former succeeds, the latter will be executed.
| | Two commands to execute only one piece of
~ User's Home directory
& put commands in the background to execute
[] The middle is a character combination that represents either of the intermediate characters
Command >1.txt 2>&1 correct output to 1.txt, error output to &1, i.e. 1.txt
Shell features, wildcard characters, input and output redirection, command history