The usage of the Linux find command is: 1. Find the file named "hello.txt" in the current path. The usage is "find ./ -name full file name"; 2. Find the root directory named "hello" .txt" file, the usage is "find ./ -name file name|xargs rm"; 3. To find and delete the file named "hello.txt", the usage is "find ./ -name file name|xargs rm".
# Let’s learn more about the usage and parameters of the find command.
Preparation conditions:
A server with Centos7.9 operating system;
Xshell terminal has been linked to the server;
1. Find the current The file whose path name is "hello.txt";
Usage: find ./ -name the entire file name
For example: find ./ -name hello.txt
Batch search for files named hello:
find ./ -name hel*
"*" is a fuzzy match
2. Find the file named "hello.txt" in the root directory;
Usage: find / -name The entire file name
For example: find / -name hello. txt
3. Find and delete the file named "hello.txt";
Usage: find ./ -name file name|xargs rm
For example: find ./ -name hello.txt|xargs rm
The above is the detailed content of How to use the find command in Linux. For more information, please follow other related articles on the PHP Chinese website!