Command 1:which
Which command to find only the directory where the command is located
For example: which LS
Command 2:whereis
Whereis command to find only the directory where the command is located + Help document location
Whereis command
Command location + Help document location
Command 3:find
Find path Lookup method parameter to locate any file
There are a number of ways to find:
1. Find by file name
Find how:-name
For example: Find/t3-name file1
Note: The filename can be used with wildcard characters
* Multiple characters
? Single character
For example: Find/t3-name fil*
2. Find by File size
Find how:-size (unit data block 512 bytes, that is, 0.5kb)
+1000
-1000
=1000
For example: find/t3-name-1000
3. Find according to the owner of the file
Find how:-user
For example: Find/t3-user XHC
4. According to the group of files to find
Find how:-group
For example: Find/t3-group greenday
5. According to the last modified time to find
Find the way:-ctime,-atime,-mtime in days as the unit
How to find:-cmin,-amin,-mmin in minutes
C change refers to the file attributes, refers to permissions, groups, owners changed
A visit
M modification means that the contents of the file have been modified
Parameters:
+ More than a long time
-How much time
I don't write anything.
For example: find/t3-mmin-120
6. According to the file type to find
Find how:-type
For example: Find/t3-type D
7. According to the I node to find
Find how:-inum
For example: Find/t3-inum 14
8. Multiple conditions
-A logic and
-O Logic or
For example: Find-size +80-a-size-100
4. After the search operation
Fixed format: Find Xxx-exec command {};
For example: Find/t3-mmin-120-exec ls-l {}; Find files that have been modified within two hours and list details
Locate
UpdateDB
Grep
Example: grep FTP file name A output a file contains FTP rows