Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of realizing Fuzzy query with linux find Command

Shulou Source: shulou.com Published: 2022-06-02 00:10:30 10月03日 Update

This article will explain in detail the method of realizing fuzzy query with linux find command. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Linux find command to achieve fuzzy query method: according to the file name fuzzy query, find the opt directory with the suffix [.log] file, the code is [find / opt/-type f-name "* .log"].

The method of realizing fuzzy query by linux find command:

Tip 1: fuzzy query based on file name: find files with the suffix .log in the opt directory

Find / opt/-type f-name "* .log"

-type f represents a file

-type d indicates a matching directory

Tip 2: find specific permission files:

Find / opt-type f-perm 755

Tip 3: find large files: (for example, find files larger than 100m in the opt directory)

Find / opt/-size + 100m

-size: indicates file size

+ means greater than a certain number

-indicates that it is less than a number.

C indicates that the units are bytes. You can change c to k _ Magi _ M _ G.

(note: when the disk space is very large, this method can quickly locate large files.)

Tip 4: find it according to time

Find / opt-mtime-10

-files modified within 10 days (+ 10 before 10 days-10 within 10 days)

Access with amin, modify with mmin, change file status with cmin

Accurate to minutes with amin,mmin,cmin to days with atime,mtime,ctime

Tip 5: find the directory in which the current directory and its subfolders belong to weblogic

Find / opt-type d-user weblogic

This is the end of this article on "the method of linux find command to achieve fuzzy query". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Files queries directories methods techniques commands articles precision suffixes file names more good practical large code content units size bytes folders Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Xiaomi Shulou Information Shulou Technology Shulou Tech Info