Linux-File search and compression

1. Create a file named hi.txt in the /tmp directory with the content of "Hello World" (using directed input).

 

2. Search for .conf files in the root directory with files smaller than 1M.

3. Count the number of files with the extension .conf in the /etc directory.

 

4. Search for files starting with net in the /etc directory and save the results to the /tmp/net.file file.

5. Look for file names starting with "f" in the individual user's home directory and search for lines containing "s" in these files.

 

6. Search the /etc directory for files that have been modified within the last day.

 

7. Use the tar command to package and compress the /etc/passwd file into /root/file.tar.gz

 

8. Create an empty folder /web/test1, unpack and release file.tar.gz to the /web/test1 directory

 

 

9. Create /work

Enter /work, execute the following command, and copy several files to the /work directory.

cp /etc/inittab /etc/services /work

Use tar to package and compress to the /tmp directory

Create a new /php directory and unpack the compressed file just compressed to the /tmp directory to the /php directory.

 

 

 

Guess you like

Origin blog.csdn.net/nikezhenhaokan/article/details/130278404