The usage and understanding of Xargs

Source: Internet
Author: User

Use:

The birth of this command is due to the inability of the pipeline output to support some commands that need to be used for xargs;

Find/sbin-perm +700 |ls-l This command is wrong.

Find/sbin-perm +700 |xargs Ls-l This is the right thing.

Syntax and parameters

Xargs-parameters + command

-0 when a sdtin contains special characters, it is treated as a general character, like /' space ' , etc.

For example:[email Protected]:~/test#echo "//" |xargs Echo

  1. [Email Protected]:~/test#echo "//" |xargs-0 Echo

  2. read in the file as sdtin

  3. -e flag -e , flag must be a space-delimited flag when xargs analysis to include is stopped when it is marked.

  4. - P Ask the user once every time a argument is executed.

  5. - N Num The number of argument that is used at the time of the execution of the command, by default, is used for all.

  6. indicates that the command is printed before execution.

  7. or -i , which depends on supports, will xargs for each item name, usually one line to assign to {} instead.

  8. no-run-if-empty  when xargs 's input is empty when the

  9. - s Num The best number of characters for the command line, which is the maximum number of command-line characters for that command after Xargs .

  10. - l

  11.   with -l

  12. delimiter, default xargs delimiter is carriage return, argument is a space, which is modified xargs delimiter

  13. - x Exit The main point is to cooperate with- s use.

  14. - P Modify the maximum number of processes

The usage and understanding of 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.