8.6 Pipe symbol and job control
The effect of a pipe character is to drop the result preceding the symbol to the command following the symbol. Not all commands are available after the pipe character, and generally commands for document operations are common, eg:cat, less, head, tail, grep, cut, sort, WC, uniq, tee, tr, split, SED, awk, and more.
Cat 1.txt | Wc-l cat 1.txt |grep ' aaa '
CTRL Z Pause a task//Transfer the paused task back with fg//
Jobs view the tasks in the background
BG[ID] Transfer the task to the foreground//to the backstage and run//
Command back & drop directly into the background
FG, get the mission to the front desk.
Pipe break: The output of the previous command as input of the following
8.7 shell variable (top) 8.8 shell variable (bottom)
PATH, HOME, Pwd,logname
ENV command
The SET command has many variables and includes user-defined variables
Custom Variable A=1
Variable name rules: Letters, numbers underline, the first cannot be a number
You need to enclose the value of a variable in single quotation marks when there are special symbols.
The summation of variables
Global Variables Export b=2
unset variable//Cancel variable//
Example:
[[email protected] ~]# a1=2[[email protected] ~]# echo $a12[[email protected] ~]# a=‘a b c ‘[[email protected] ~]# echo $a a b c
8.9 environment variable configuration file
/etc/profile user Environment variables, interaction, login only execution
/ETC/BASHRC user cannot log in, execution shell is effective
~/.bashrc
~/.bash_profile
~/.bash_history
~/.bash_logout
Ps1= ' [\033[01;32m]\[email protected]\h[\033[00m]:[\033[01;36m]\w[\033[00m]$ '
Pipe character and job control shell variable environment variable configuration file