Linux Shell Basics

Source: Internet
Author: User

Pipe character
| Represents the output of the previous instruction as input to the latter instruction
#cat/etc/passwd|wc-l

Such as

[Email protected] ~]# cat/etc/passwd|wc-l
19
Job Control

#find./-type F View the current = Directory file
#find./-type F |wc-l Print the current number of files
[[email protected] ~]# Find/-type f|wc-l
18
Ctr+z pausing a process in progress
FG Resume Paused Task * *

[Email protected] ~]# vim 1.txt

[1]+ has stopped Vim 1.txt
[Email protected] ~]# vim 2.txt

[2]+ has stopped Vim 2.txt
[[email protected] ~]# FG 1
Vim 1.txt
[[email protected] ~]# FG 2
Vim 2.txt
Jobs view tasks that are paused or running in the background
BG puts suspended tasks in the background

Summary: In Job control
CTL +z Suspend Service
FG Recovery Service
Jobs view tasks that are paused or run in the background
BG puts the suspended task back on the day after tomorrow, the sign is can write the command
Vmstat 1 commands for observing System status

Variable
Env set view system environment variables
Rules for variable names: letters, numbers underline, the first cannot be a number
Such as:
[Email protected] ~]# A_a1=ou
[Email protected] ~]# echo $a _a1
Ou
[[email protected] ~]# a= ' ADF '
[Email protected] ~]# echo $a
Adf
[Email protected] ~]# a=1
[Email protected] ~]# b=2
[Email protected] ~]# echo $a $b
12
environment variable configuration file
Two dimensions: One is the system environment variable under/etc/, and the other is: environment variable under home directory
/etc/profile User Environment variables, interactive, login only execution
/ETC/BASHRC user does not have to log on, execution shell is effective
~/.bashrc

Linux Shell Basics

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.