The small knowledge points used in the Linux system accumulate

  

preface: Do things under ubuntu, run some commands under the terminal, or do some operations in vim, naturally need to use some small knowledge points, not systematically Look at the "Bird's Dish", basically what problems you want to achieve, find a blog, learn the knowledge points, some scattered, and then a little accumulation.

1. Batch command sh:

When running multiple commands in the terminal, write those commands to a file, and name XX.sh, run sh XX.sh in the terminal. Can be broken, the terminal will run the command inside the XX.sh file one by one.

2.echo:

In the batch command, you need to use the command to output some of the things you want to the terminal, the echo can be broken, like the print inside python, under the terminal echo "================" As in python, the program is running under the mark of print 30*"*".

3.Pipe Redirection>,>>:

> is to redirect the output to the specified file, if the file already exists, it will be rewritten, the original content of the file Will not be retained.
>> is to append the output to the back of the file, the original content of the file will be retained. $ ls >> log.txt or $ ls > log.txt There are also script, tee and other commands, and then read down systematically when you are idle.


4.grep, awk, sed:

5. To be continued. . .

Copyright © Windows knowledge All Rights Reserved