linux learning record 3

Input redirection: command <file

Output redirection: command> file

Command >> file additional written

Command> files emptied write

Error information is written to the file command 2> file is written to clear the error message  

2 command >> file additional write error message

All correct error message written to the file command &> file retains the original file contents, additional file written on the back

ls> xiaolu the original you want to print the screen contents of the above print to a file

Because it is written emptied only once content.

wc -l <anaconda-ks.cfg file to find the number of rows

Pipe symbol | will command a command to process b

ls -l | wc -l to see how many files

echo linuxprobe | passwd --stdin linuxprobe Linux probe reset a user's password

echo "hahaha" | mail -s "hohoho" linuxprobe send a message

* Wildcard ls / dev / sda * displays the contents of all sd

ls -l ./dev/sda[0-9]

Variables $ 

PRICE=5

echo $ PRICE print out of 5

echo Price is $PRICE   

Escape \ echo Price is \ $$ PRICE   

Back quotes `` shell script Chapter IV

echo `uptime` commands to print directly to the screen

alias haha ​​= "systemctl restart network" is equivalent to the systemctl restart network assigned to haha, haha ​​is restarted after the input card.

PATH: BASH assistant

DEATH = "/ usr / local / share / info" $ DEATH went into the info directory

If you want to share this variable, enter the export DEATH so that other users can also use $ DEATH, this is called a global variable

Everything vim linux file, modify the deployment of a service it is in the service profile

Finish.

 

 

 

Guess you like

Origin www.cnblogs.com/1024ndd/p/11137406.html