Take notes on Linux private food from laruence (7) -- File Search and file management 1

Source: Internet
Author: User
1. search for executable files which displays the complete path of an executable file according to alias & mdash; & gt; $ PATH sequential search View system environment variable whereis search an executable tool and its related configuration, help slocateslocate or locate all files

1. search for executable files

Which

Display the complete path of an executable file

Search by alias-> $ PATH

View system environment variables

Whereis

Search for an executable tool and its related configurations and help

Slocate

Slocate or locate keywords

All files and directories whose names and paths contain key fields are displayed.

Slocate first makes the current directory structure into a database, and then searches for matching records in this database

Find

Find [path] [parameter] [expression]

Recursively searches for files in a specified path

Supports searching by various criteria

Allows you to use commands to search for files.

Search by file type

 

2. operate on the files found

Syntax: find [path] [parameter] [expression]-exec command {}\;

{} Indicates the file found by find.

\ Prohibit conversion

; Indicates the end of the command.

III. common file Operation Commands

Wc

Grep displays the rows in the file that match the keyword.

Sort sorts text in order and sends it to display

Diff report text differences

Location of comp report text difference

Uniq removes duplicate rows from the file

Show a column in the file

Paste concatenates text by column

 

Related Article

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.