Today, users who want to learn Linux system or just contacted this system are blessed. Today, this tutorial teaches you how to use the Find command. In the system, the command line is very powerful, so usually everyone is better. How many to learn some.
The first is the syntax of find:
find [starting directory] looking for conditional operations
There is also a way of expression: find PATH OPTION [-exec COMMAND { } \\; ]
Because the find command will recursively search for files in the file and its subdirectories based on the options we gave, that is, looking for conditions, so I think this place is “The starting directory” is very good.
The search condition in this command can be a compound condition consisting of logical operators not, and, or. The meanings of the logical operators and, or, not are:
(1) and: logical AND, expressed in the command by “-a”, is the default option of the system, indicating that only the conditions given When both are satisfied, the search for conditions is satisfied. For example:
find –name ’tmp’ –xtype c -user ’inin’
% This command looks for all files that satisfy all three given conditions
(2) or: logical OR, expressed in the command with “-o”. This operator indicates that the search condition is satisfied as long as one of the given conditions is satisfied. For example:
find –name ’tmp’ –o –name ’mina*’
% The command query file name is ’tmp’ or match & rsquo; Mina*’ all files.
(3) not: Logic is not indicated in the command by “!”. This operator indicates that the file that does not satisfy the given condition is found. For example:
find ! –name ’tmp’
% This command queries all files whose file name is not ’tmp’.
It should be noted that when using a lot of logic options, you can bracket these options. In order to avoid the shell itself misunderstanding the parentheses, you need to add the escape character “\\” before the phone number to remove the meaning of the brackets. Example:
find \\(–name ’tmp’ –xtype c -user ’inin& rsquo; \\)
I feel that now I should say the next query condition, The content of the option in find:
In the option, there are specific parameters:
-name & rsquo;string & rsquo; find the file name matches all the files of the given string, string The wildcard characters *, ?, [ ] are available.
-lname ’String & rsquo; Find all symlink files whose filename matches the given string. The wildcards *, ?, [ ] are available in the string.
-gid n Find all files belonging to the user group with ID number n.
-uid n Find all files belonging to a user with ID number n.
-group ’String & rsquo; Find all files belonging to the user group named string.
-user ’String & rsquo; Find all files belonging to the user name given by the string.
-empty Look for a directory or file of size 0.
-path ’String & rsquo; Find all files with the path name matching the given string. The wildcard characters *, ?, [ ] are available in the string.
-perm Permissions Find files and directories with the specified permissions, which can be as 711,644.
-size n[bckw] Finds the file of the specified file size. The characters after n represent the unit. The default is b, which represents a block of 512 bytes.
-type x finds a file of type x, with x being one of the following characters:
I believe that everyone has encountered it. When installing Thunder, I accidentally installed the Th
Author: Mayon on the current situation of view, Windows XP system is still on Win7 and Win
Recently, many users are reporting that launch csm cannot be changed. What is going on? In fact, thi
In todays society, WeChat is the most popular chat tool. When we log in to the WeChat webpage, if We
What are the reasons for the loss of u disk data?
What should I do if the computer boots up to display client mac addr?
Linux system rookie management top ten common error inventory
Use F11 to recover crash system
Windows2003 system quick login has a high trick
Ubuntu development server configuration (SSHserver, login to remote server for file total
How to solve the CPU Fan Error error when the computer is turned on?
Windows system must be aware of the three things before reinstalling
Repair Ubuntu boot partition after reinstalling XP
How to solve the problem when Thunder downloads to 99%?
Several backup tools under Linux system competition
Windows+ubuntu dual system reinstalled windows after the boot repair
Ways to Troubleshoot VMware Snapshots
How to solve the shellexperiencehost.exe program under Win10
Win10 preview version 10525 new features simple experience video
How to check the patch records installed in the Win8 system?
Win8 view two ways of memory card model brand
What can I do if SmartScreen cannot be set up in Win10 and needs a system administrator?
How to use Windows XP to achieve unified network shutdown
Take you to experience different IE8 in Windows7
FSO solution in Win2000 server
Refuse to repeat the work, change the Win 7 file association