Home  >  Article  >  Operation and Maintenance  >  How to use find file command in linux

How to use find file command in linux

angryTom
angryTomOriginal
2020-02-26 17:13:289510browse

How to use find file command in linux

How to use the Linux file search command find

The operation method of Linux-file search command find is as follows:

Recommended : Linux self-study video

1. Full search, or you can search in a specified directory. find Search directory -name target name, find / -name file

How to use find file command in linux

2. In this search, you will see an exact match of file, which is case-sensitive. You can use - iname is not case sensitive, find / -iname file. In this way we can find more relevant files in uppercase letters.

How to use find file command in linux

#3. We first use the * wildcard character to match the relevant files containing file. It is case-sensitive: find / -name *file*. Case-insensitive: find / -iname *file*. If you match like this, there will be more files, and the more precise the match, the easier it will be for searching.

How to use find file command in linux

4. find search directory -size file size. Next we search for files larger than 100MB, which should actually be 102400KB*2. All search commands are: find / -size 204800. The - sign means less than, writing the number directly means equal to.

How to use find file command in linux

5. find search directory -user user name. Here is the search for files belonging to the username user1. How to add and delete usernames in Linux, you can refer to the Linux user management command: find / -user user1.

How to use find file command in linux

6. Find search directory -type d. Find all directories under a directory: find /tmp -type d.

How to use find file command in linux

#7. Find search directory -cmin - time (unit minutes). Search for files modified within 1 hour under etc. There are too many files under the root directory. Specify a directory: find /etc -cmin -60.

How to use find file command in linux

8. Of course, the find command can add multiple options together to query: -a means that both the pre- and post-conditions must be met, -o means that only one condition is met, so we Filtered files can be clearly seen.

How to use find file command in linux

php Chinese website, a large number of programming learning courses, welcome to learn.

The above is the detailed content of How to use find file command in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Who developed linuxNext article:Who developed linux