Pipe character and job control shell variable environment variable configuration file

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.