Mkdir/data Creating the Data Directory
CD/;mkdir/data1 Create data1 Directory
CD/Entry/root directory
RM-RF data1 Delete data1 directory
Cd/data into the Data directory
Touch Ceshi.txt Creating Ceshi.txt Documents
VI Ceshi.txt into ceshi.txt for editing
Press I to enter edit mode
Input Diyici
Ceshi
Press ESC to exit edit mode, press: Wq Save and exit
Cat/data/ceshi.txt viewing the contents of a Ceshi.txt document
echo "Diercishuru" >/data/ceshi.txt "Diercishuru" into Ceshi.txt and overwrites the original content
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/8E/45/wKioL1i7uNnBooVJAAAz6X0wo-o287.jpg "title=" echo input overlay content. jpg "alt=" wkiol1i7unnboovjaaaz6x0wo-o287.jpg "/>
Change > to >> to add content after the original and not overwrite the original content
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/8E/47/wKiom1i7uZ7zFe_1AAA8rcQGVbs589.jpg "title=" echo input but do not overwrite content. jpg "alt=" wkiom1i7uz7zfe_1aaa8rcqgvbs589.jpg "/>
Cat >>/data/ceshi.txt<<eof Enter the content to be added, and finally enter EOF to complete and exit
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/8E/47/wKiom1i7umKB2XlJAABKA4tTe80626.jpg "title=" cat EOF adds content to the original. jpg "alt=" wkiom1i7umkb2xljaabka4tte80626.jpg "/>
Create a new/xuexi directory and copy the Ceshi.txt under/data to the/xuexi directory
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8E/45/wKioL1i7u06C_JR2AABEhsJ3uuI032.jpg "title=" Cp.jpg "alt=" Wkiol1i7u06c_jr2aabehsj3uui032.jpg "/>
Move Ceshi.txt under the/xuexi directory to the/XUEXI2 directory
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/8E/47/wKiom1i7u_jAmIEqAABYRE5j2KA997.jpg "title=" Mv.jpg "alt=" Wkiom1i7u_jamieqaabyre5j2ka997.jpg "/>
Remove Ceshi.txt from the/xuexi2 directory
Delete/xuexi and/xuexi2 directories
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8E/47/wKiom1i7vLTwwhY0AABr7zYWTkk168.jpg "title=" Rm.jpg "alt=" Wkiom1i7vltwwhy0aabr7zywtkk168.jpg "/>
View the Ceshi.txt file, but exclude Diercishuru characters, not included
grep one of the most important core commands, the old three of the Three Musketeers
-V is an excluded content
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/8E/45/wKioL1i7wWqx_AXbAABKZKOWNOo326.jpg "title=" grep- V.jpg "alt=" Wkiol1i7wwqx_axbaabkzkownoo326.jpg "/>
Because the Diercishuru character is the first line, the first row is excluded, only the contents of the following 2 rows are displayed
You can use Tail-2 ceshi.txt to view the contents of the following 2 rows
650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M01/8E/45/wKioL1i7wgzi8C2NAAAqWhOEkME498.jpg "title=" tail- 2.jpg "alt=" Wkiol1i7wgzi8c2naaaqwhoekme498.jpg "/>
Similarly, Head-2 Ceshi.txt is looking at the first 2 rows of content
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/8E/48/wKiom1i7wm-jRzwzAAAqRX3rOPs716.jpg "title=" head- 2.jpg "alt=" Wkiom1i7wm-jrzwzaaaqrx3rops716.jpg "/>
sed take all kinds of content (the Three Musketeers's Dick)
Sed-n/li/p Test (-n = Cancel default raw output, p is print)
View the lines in the Ceshi.txt document that contain Sanci
650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M00/8E/48/wKiom1i7w23AKlW-AAAl2C9E6OQ240.jpg "title=" sed- N.jpg "alt=" Wkiom1i7w23aklw-aaal2c9e6oq240.jpg "/>
awk the boss of the Three Musketeers
Display the contents of a row containing Sanci
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/8E/46/wKioL1i70Eqg71BfAAAifluhF6w644.jpg "title=" Awk.jpg "alt=" Wkiol1i70eqg71bfaaaifluhf6w644.jpg "/>
This article is from the "interconnection" blog, please be sure to keep this source http://jschinamobile.blog.51cto.com/11464420/1903425
Basic commands in the Linux Foundation