Get the App
SLTechnology News&Howtos  ›  Servers  › 

How find in linux is case-insensitive

Shulou Source: shulou.com Published: 2022-05-31 10:56:40 10月03日 Update

Editor to share with you how find in linux is case-insensitive, I believe most people don't know much about it, so share this article for your reference. I hope you can learn a lot after reading this article. Let's learn about it together.

In linux, you only need to set the option parameter followed by the find command to "- iname" to achieve case-insensitive lookup, syntax "find search path-iname" file name "". The find command is used to find files in the specified directory, and the "- iname" parameter sets the lookup mode to ignore case.

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

In linux, case-insensitive lookups can be achieved simply by setting the option parameter followed by the find command to "- iname".

Find command: find search path-iname "file name".

Note: the find command cannot take the parameter-I.

Description: find command

The find command is a ubiquitous command and is one of the most useful commands in linux. The find command is used to search for files in a directory (and subdirectories). You can specify some matching criteria, such as finding files by file name, file type, user, or even a timestamp.

Syntax:

Find path-option [- print] [- exec-ok command] {}\

Parameter description:

Find judges path and expression according to the following rules, the first-(), on the command line! The first part is path, followed by expression. The current path is used if the path is an empty string, and-print is used as the default expression if the expression is an empty string.

There are as many as 20 or 30 options available in expression, and only the most commonly used ones are introduced here.

-mount,-xdev: only check and specify files in the same file system to avoid listing files in other file systems

-amin n: read in the past n minutes

-anewer file: a file that was read later than the file file

-atime n: files that have been read in the past n days

-cmin n: modified in the past n minutes

-cnewer file: files that are newer than the file file

-ctime n: files that have been modified in the past n days

-empty: empty file

-gid n or-group name: is gid n or group name name

-name name,-iname name: a file whose name matches name. Iname ignores case

-size n: the file size is n units, b represents a block of 512 bytes, c represents the number of characters, and k indicates that kilo bytes,w is two bytes.

-type c: a file of type c.

D: directory

C: font device file

B: block device file

P: named storage column

F: general documents

L: symbolic link

S: socket

-pid n: process id is the file of n

You can use () to separate expressions and use the following operations.

Exp1-and exp2

! Expr

-not expr

Exp1-or exp2

Exp1, exp2

The above is all the content of the article "how find is case-insensitive in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: File command size parameter directory file name article system path search content block name trail type device syntax ubiquitous not much bit Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS vpn Shulou Technology Microsoft Docker