Search for linux Files Or Files

Source: Internet
Author: User

For linux Files or files, search for whereis <program name> www.2cto.com to find the software installation path-B to find only binary files-m to find only help files-s to find only source code-u to exclude files of the specified type -f only displays the file name.-B <directory> searches for the binary file in the specified directory.-M <directory> searches for the help file in the specified directory.-S <directory> searches for the source code in the specified directory. www.2cto.com locate <File name> Search for file-d in the file index database <database path> Search for the specified database updatedb to update the file index database find [path] <expression> Search for file-name <expression> Search for a file by file name-iname <expression> Search for a file by file name, ignore case sensitivity-path <expression> Search for files by path-ipath <expression> Search for files by path, ignore case-amin <minute> files accessed in the past N minutes-atim E <days> files accessed in the past N days-cmin <minutes> files modified in the past N minutes-ctime <days> files modified in the past N days-anewer <reference File> a file that has been read later than the reference file-cnewer <reference File> a file that has been modified later than the reference file-size <size> searches for files based on the file size, unit: B c w k M G-type <file type> Search for files based on the file type. Block B Device c character device d directory
P pipeline file f Common file l link s port file-user <user Name> search file by owner user-uid <uid> search file by UID-group <group Name> search by owner group file-gid <gid> Search for files by GID-empty search for empty Files Search for rows matching the specified string from the file content: $ grep "searched string" File Name: Find the row matching the regular expression from the file content: $ grep-e "Regular Expression" the file name is case insensitive: $ grep-I "searched string" name of the file to find matched lines: $ grep-c "searched string" name of the file to find lines that do not match the specified string from the file content: $ grep-v "searched string" the file name starts from the root directory and searches for all extensions. log, and find the line "find/-type f-name" * containing "ERROR "*. log "| xargs grep" ERRO R "the system finds the httpd. conf file and displays the httpd. conf file on the screen. Find/-name "httpd. conf "-ls find a file in the root directory. -name "test" searches for the grep-r "zh_CN" file containing a string in a directory ". /It Can Be output to the file grep-r "zh_CN"> find.txt
 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.