Home >Operation and Maintenance >Linux Operation and Maintenance >Why is Linux find not case sensitive?
In Linux, you only need to set the option parameter following the find command to "-iname" to achieve case-insensitive search, the syntax is "find search path -iname "file name"". The find command is used to search for files in the specified directory. The "-iname" parameter sets the search mode to ignore case.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
In Linux, you only need to set the option parameter following the find command to "-iname
" to achieve case-insensitive search.
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 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 conditions, such as finding files by file name, file type, user or even timestamp.
Syntax:
find path -option [ -print ] [ -exec -ok command ] {} \;
Parameter description:
find determines path and expression according to the following rules, the first - (), ! before The part is path, followed by expression. If path is an empty string, the current path is used. If expression is an empty string, -print is used as the default expression. There are as many as twenty or thirty options that can be used in
expression. Only the most commonly used ones are introduced here.
-mount
, -xdev
: Only check files in the same file system as the specified directory and avoid listing files in other file systems
-amin n
: Read in the past n minutes
-anewer file
: File read later than file file
-atime n
: Files that have been read in the past n days
-cmin n
: Files that have been modified in the past n minutes
-cnewer file
: File newer than file file
-ctime n
: File modified in the past n days
-empty
: empty file
-gid n
or -group name
: gid is n or group name is name
-name name
, -iname name
: The file name matches name. iname
Will ignore case
-size n
: The file size is n units, b represents a 512-byte block, c represents the number of characters, k Represents kilo bytes, w is two bytes.
-type c
: File type is c.
d: Directory
c: Font device file
b: Block device File
p: Named storage list
f: Normal file
l: Symbolic link
s: socket
-pid n
: process id is file n
you You can use ( ) to separate expressions and use the following operations.
exp1 -and exp2
! expr
-not expr
exp1 -or exp2
Linux Video Tutorial》
The above is the detailed content of Why is Linux find not case sensitive?. For more information, please follow other related articles on the PHP Chinese website!