Today, Mayuyu Some of the commands that are commonly used in Linux.
1. grep command
grep is used to filter what you need, and the syntax is as follows
grep Mayuyu--color
Filters out all rows that contain Mayuyu, and grep also supports regular expressions.
2. SED command
There are two main issues when editing a file using the normal VIM editor
(1) When the file is relatively large, you need to open the file, occupy a large amount of memory.
(2) When editing a file, you must interact, so it is difficult to call vim and so on.
Sed belongs to the stream editor, the so-called stream editor is in the editing of files, you can not have to read the entire file into memory, you can line a
Read in, and then read the next line when the operation is complete, which takes up less memory.
The most commonly used command is the substitution of strings, such as in a file, you need to replace a string with another string, the command is as follows
Indicates that var in the Hello.cpp file is replaced with ans, and the characters that need to be replaced are enclosed in \< and \> .
Displays a string in the first line of the original file, using the following command
The line that starts with int is the 7th line in the source file, and the line is displayed with "=".
Learn more about the SED reference:http://www.cnblogs.com/edwardlost/archive/2010/09/17/1829145.html
The use of grep,sed in Linux