Home > OS >  Linux18 foundation problem
Linux18 foundation problem

Time:10-23

1, create DZQC folder, and enter DZQC folder, and creating 1. TXT file

The Mkdir DZQC
CD DZQC
Touch 1. TXT
2, put the DZQC folder 1. TXT copy onto a layer of temp folder
Cp. 1. TXT../temp

3, with at least two ways to 1. TXT file writing content (optional)
Vi 1. TXT
Echo jdbjnbhy> 1. TXT
Cat> 1. TxtBgijjkk
EOF


4, delete the temp folder
The RM -r temp

5, in DZQC one-time create 2. TXT 3. TXT 4. TXT and put 2. TXT) moved to tier on a directory
Touch 2. TXT 3. TXT 4. TXT MV 2. TXT..

6, now 3. TXT file
Aaaaa
Bbbbb
Cccccc
Please print out the first two lines, had better use two methods to complete the
The Grep -v Cccccc 3. TXT
The Head - 2 3. TXT

7, creating a group of student, and create user zhangsan, zhang SAN's primary group for student
Groupadd student useradd - g student student

8, the DZQC folder 1. TXT 2. TXT 3. TXT compressed into RRRR. Tar. Gz zip
The Tar - cuf RRR. Tar. The gz 1. TXT 2. TXT 3. TXT

9, the DZQC folder 1. TXT 2. TXT 3. TXT compressed into TTTT. Zip
Zip - rv TTT. Zip./DZQC/1. TXT 2. TXT 3. TXT

10 and modify 1. TXT file permissions u can read can write, g can be read to write, o can read

Chmod -r 664 1. TXT
11, modify 1. TXT belongs to the user, from the root to zhangsan

Chown -r zhangsan
1. 12, the DZQC folder, in addition to TXT other full play compressed
Zip - rv yyy.zip * - x 1. TXT

13, check 1. TXT, 2. TXT, the contents of the 3. TXT file

The cat 1. TXT 2. TXT 3. TXT
14, use yum uninstall tree package
Yum remove tree - y

15, use the yum command to install LRZSZ packages

Yum install LRZSZ - y
16, using the sed command, the 1. TXT file, have GGGG string lines of old replaced by new
Sed 'GGGG/' s/old/new/g 1. TXT


17, find the current folder is more than 10 k file
The find./size + 10 k


18, find 30 days before the file, and find the file delete
The find./mtime + 30 | xargs rm - r
  • Related