Pipe and job control, shell variables, environment variable configuration files

Source: Internet
Author: User

Pipe character
    • | Function: The output of the preceding command is given to the following command job control
    • CTRL Z pauses a task
[[email protected] ~]# vim 1.txt [1]+  已停止               vim 1.txt[[email protected] ~]# vim 2.txt [2]+  已停止               vim 2.txt[[email protected] ~]# jobs[1]-  已停止               vim 1.txt[2]+  已停止               
    • The jobs command is used to display the Task List and task status in Linux, including tasks that run in the background.
    • FG resumes a paused task, which can be followed by a numeric parameter that represents the resumption of the first few paused tasks
    • BG background running tasks, non-stop output information, but do not delay running commands
Shell variables
    • Path,home,pwd,logname
    • Variables can be viewed by env or set, and system variables are generally larger English letters.
    • Rules for variable names: letters, numeric underlines, first digits cannot be numbers
    • You need to enclose the variable in single quotation marks when there are special symbols.
[[email protected] ~]# echo $a$bb1[[email protected] ~]# echo ‘$a$bb‘$a$bb
    • The Pstree command displays all the processes in the Linux system in a tree-shaped structure. If you do not have this command: Yum install-y psmisc
[[email protected] ~]# pstreesystemd─┬─NetworkManager───2*[{NetworkManager}]        ├─agetty        ├─auditd───{auditd}        ├─chronyd        ├─crond        ├─dbus-daemon───{dbus-daemon}        ├─firewalld───{firewalld}        ├─lvmetad        ├─master─┬─pickup        │        └─qmgr        ├─polkitd───5*[{polkitd}]        ├─rsyslogd───2*[{rsyslogd}]        ├─sshd───sshd───bash─┬─pstree        │                    └─2*[vim]        ├─systemd-journal        ├─systemd-logind        ├─systemd-udevd        ├─tuned───4*[{tuned}]        
    • Export Global settings variable, in the same sshd under the child shell know this variable, down into effect.
    • unset variable name: Cancel variable
environment variable configuration file
    • Configuration file for System environment variables
      • /etc/profile: This file presets several important variables, such as path, USER, LOGNAME, MAIL, INPUTRC, HOSTNAME, histsize, umask, etc.
      • /ETC/BASHRC: This file is mainly preset umask and PS1. This PS1 is the string that precedes us when we enter a command.
    • Configuration file for user environment variables
      • . bash_profile the file name of the user's personalization path and environment variable at the top of the document. Each user can use the file to enter their own shell information, which is performed only once when the user logs on.
      • . BASHRC the file contains bash information for its own shell, which is read when logged in or every time a new shell is opened.
      • . bash_history This file is used to record the command history.
      • . bash_logout when you exit the shell, the file is executed, and you can put some work that needs to be cleaned into this folder.

Pipe and job control, shell variables, environment variable configuration files

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.