1 command format:
$ find
Most common example: Find file name (Ignore case)
$find. -iname Sqlquery.java
1.1
The directory to search for and all of its subdirectories. The current directory is assumed by default. Find default recursion specifies the directory. There can be multiple directories, separated by spaces
Working under Linux, some commands can be much more efficient. This article will introduce you to the Find, grep command, his brother can be considered a necessary Linux command, I almost every day to use them. This article is structured as follows:
Find command
General form of the Find command
Common options and examples for the
Example tree diagram.|--Test_dir| '--Dir_test_doc.text|--Test_dir2| |--dir2_test_doc.txt| '--Dir2_test_doc2.txt|--Test_doc1.text'--Test_doc2.txt2 directories, 5 files1. Find the line for the contents of the file:grep "searched string" file nameFor example:[[email protected] demo]# grep "doc1_content" Test_doc1 Testdoc1_content2. Find the found string contained in the text file in this level (current) direct
Tag:commandlinux root directory linux the Find command searches the directory structure for the file and performs the specified action. The Linux Find command provides quite a lot of search criteria and is powerful. Because find has powerful features, it has a lot of options, most of which are worth taking the time to look at. Even if the system contains a netw
How to use the Linux Find command under a Linux system, as in the following example.I. Common usage examples of Find in Linuxfind Path-option [-print] [-exec-ok command] {} \;#-print output of the found file to standard output#-exec command {} \; The command operation-----The file to be traced, with a space between {} and \;#-ok and-exec are the same, except to consult the user before operation=============
The Find command is one of the most powerful commands, but it is also one of the most difficult commands for command-line structures to master.
# Find/-print | WC-L displays the number of files and directories in the system.
# Find/-user $LOGNAME-print displays all files and directories for that user in the system.
# Find
Working under Linux, some commands can be much more efficient. This article will introduce you to the Find, grep command, his brother can be considered a necessary Linux command, I almost every day to use them. This article is structured as follows:
Find command
General form of the Find command
Common options and examples for the
Find some common examples of common parameters and some specific usage and considerations.1. Use the name option:The file name option is the most common option for the Find command, either used alone or in conjunction with other options. You can use a file name pattern to match files, remembering to enclose the filename pattern in quotation marks. Regardless of the current path, if you want to
1, locateLocate command and find find files similar function, but locate is through the update program to the hard disk all the files and directory data first set up an index database, in the execution of LOACTE directly to find the index, query faster, the index database is generally managed by the operating system, However, you can also directly release the upd
About the Find commandBecause find has powerful features, it has a lot of options, most of which are worth taking the time to look at. Even if the system contains a network file system (NFS), the Find command works equally well in the file system, only you have the appropriate permissionsWhen running a very resource-intensive
Briefly:The Find command in Linux is a powerful real-time lookup tool that uses the path given by the user to find files in the file system under that path. As a result, it takes time to traverse a larger file system, and the Find command takes up a lot of resources, so its job is to find it slightly slower, but it can
Linux Learning-find command
Used to look up files in the file tree and make the appropriate processing
Command format:
Find Pathname-options [-print-exec-ok ...]
Command parameters:
The directory path that the Pathname:find command looks for. For example, to represent the current directory, with/to represent the system root directory.
The-print:find command outputs matching files to the standard output.
Find A traversal lookup of the entire system without specifying a lookup directory use Format : Find [ specify Find directory ] [ find rule ] [ action executed after find ][ Specify Find directory ] For example :[Email protected]
I. Using the file name lookup method:For example, suppose you forget httpd.conf the file is in the directory of the system, even if it is not known somewhere in the system, then this command can be used as follows: Find/-name httpd.conf This command syntax seems to be easy to understand, is directly behind find write-name, indicating that the system according to the file name, and finally write httpd.conf t
The Linux Find command searches the directory structure for files and performs the specified actions. The Linux Find command provides quite a lot of search criteria and is powerful. Because find has powerful features, it has a lot of options, most of which are worth taking the time to look at.Even if the system contains a network file system (NFS), the
File Lookup: Find eligible files on the file system, provided that youImplementation Tools on Linux systems: Locate,findLocateDepending on the implementation of the built-in index library, the system is automatically implemented, once the file changes need a certain period of time to update. You can also update the data manually. The entire file system needs to be traversed during the index build process, which consumes resources extremely.Working cha
)-Make a directoryThird: whereis--finder /manuals /source files Whereis is also a secondary command that queries the location of commands in a Linux system and the location of the help documents being queried for commands;[[email protected] zhangsp]# whereis pwd mkdir passwd ls//view pwd,mkdir,passwd,ls four out of The location of the command in the Linux system, and the location of the command's Help document;PWD:/bin/pwd/usr/share/man/man1p/pwd.1p.gz/usr/share/man/man1/pwd.1.gzmkdir:/bin/mkdir
We often find a file in Linux, but do not know where to put it, you can use some of the following commands to search:Which view the location of the executable file.Whereis View the location of the file.Locate to view the file location with the database.Find actual search hard disk query file namewhichThe purpose of the which command is to search for the location of a system command in the path specified by the path variable , and return the first sear
Find command:In Linux file management, the Find command is a powerful real-time lookup tool that completes file lookups by traversing the file system hierarchy under a specified path.Features: Slow lookup (because you are looking from the root), exact lookups, real-time lookups.Usage:Find [OPTION] [Find starting Path] [search criteria] [Handling Action]
Find/-name httpd.conf Find/ -name access_log 2>/dev/null find/etc-name ' *srm* ' Find /-amin-10 # Lookup in the Department Last 10 minutes of access to files find /-atime-2 # Find files accessed in the last 48 hours of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.