Linux file search and grep command _find

################## find command ###################
among qualifying system search file names

* Matches any content
? Match any one character
[] matches any character within the brackets

# Ignore case
find / root -iname install.log

According to the owner of the # search
find / root -user root


# Do not find the owner of the file
find / root -nouser

 

# 10 days ago to find modified files
find / var / log / -mtime +10

-1010 days to modify the file
1010 Tian day modified file
+10 10 days before the modified file

atime file access time
ctime change file attributes
mtime modify the contents of the file


# Find the file size is 25kb file
the Find. -Size 25k
-25k files less than 25kb of
25k equal to 25kb file
files larger than 25kb of +25


Find # 2678 i-node is a file
find. -Inum 2678

# Find greater than and less than 50k 20k file
find / etc -size + 20k -a -size -50k

-a and
-o or

# Find greater than and less than 50k 20k file, and displays details
find / etc -size + 20k -size -50k -exec ls -a -lh \;

exex / -ok command {} \; command performs an operation on the search results

 

############# grep command ###################
match qualifying string in the file which

-i Ignore case
-v investigation specified string (inverted)

 

Guess you like

Origin www.cnblogs.com/helloworld123/p/11440402.html