Unix Common Command Index (ECHO,FIND,XARGS)

Source: Internet
Author: User

Echo

echo [OPTIONS] [string]-print STRING plus a line break

-N Do not print end of line break

-E After the string is escaped and printed

-E does not escape string for direct printing

Find

Find [-h| l| P] [starting-point] [expression]

The default starting-point is the current directory ".".

-H/L/P:-H is not a trace symbolic link,-l is a trace symbolic link,-h is a symbol link only in command parameters

Expression list: (Can be used in front of each expression! Symbol table negation)

-name Name search content exactly matches the name of the file, name can be used with the * wildcard character

-iname NAME ditto, case insensitive

-type type qualifies the type of file to be searched, D is the directory, and F is the file

-empty only search for empty directories or files

-perm 777 search for only 777 files

-depth n search only for directories with current depth n

-user user searches only for files owner is user

-print for each qualifying file, the print file name is followed by a newline character

-print0 for each qualifying file, the print file name is followed by the

-regextype Sed-regex ". */regex" for each qualifying file, use the regular expression regex to filter the results (preceded by. */is to match prefix directory)

-exec COMMAND \; For each qualifying file, execute the command, note that a semicolon is required at the end of the command, the Add \ symbol is escaped if necessary, and the current file name is referenced using the symbol {}.

-ok COMMAND \; Same as-exec, but ask before each command executes

Xargs

Xargs [OPTIONS] [UTILITY [argument ...]

The default behavior is to read the standard input character stream and cut it with delimiters (by default, including spaces, tabs, newline characters, and EOF) and execute the [UTILITY [argument ...] command with the resulting cut.

When EOF is encountered, it stops automatically.

-0 cut for input byte stream (use with find-print0 instead of default delimiter)

-e eofstr use eofstr as the closing symbol

-I replstr does not cut with the cut, but calls utility on each line of the input, using REPLSTR to represent each row (usually Replstr is "{}"). REPLSTR is replaced five times in utility arguments, sixth and above Xargs not replaced.

When used with 01, instead of a newline character, it is split with

-L number does not cut with a cut, but is called with the data of this number row after every number row is read utility

-N number is cut and the results are grouped by each number, using each set of results as parameters, calling utility

-X finds that if the number of parameters is insufficient, terminate Xargs immediately

-T print the instructions to be executed to stderr before executing utility

-p maxprocs Parallel mode, up to Maxproc process execution

-P asks the user for each instruction to confirm that it should be executed

-R When the input does not contain nonblank characters, the command is not executed (by default, even if the input is empty) [GNU Extension]

Unix Common Command Index (ECHO,FIND,XARGS)

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.