Function analysis of commands before and after xargs connection

Source: Internet
Author: User
Analysis of functions of xargs commands before and after xargs connection: find-typef-name & quot; * log & quot; -print | xargsls-l will be output after the command is executed for a period of time, that is, after the find is completed, the result is an echo to ls as the input, the usage of xargs is as follows: # find/-type f-name "*. log "-print | xargs ls-l # The output is generated after the command is executed for a period of time. that is, after the find operation is complete, the result is an echo to ls as the input, ls # find/-type f-name "*. log "-print | xargs-I {} ls-l {} # will have output immediately, that is, when one is found, there will be output; each result of find is executed n times as the input of a single ls. the-p parameter prompts you to confirm whether to execute the command. the-p parameter shows the differences between the preceding two commands. # Find/-type f-name "*. log"-print | xargs-I {}-p ls-l {} ls-l/configassist. log ?... Y-rw-r -- 1 root system 0 Jun 27 2012/configassist. logls-l/etc/tunables/lastboot. log ?... Y-rw-r -- 1 root system 322 Jun 27 2012/etc/t *****/lastboot. logls-l/home/cft/CFT/distrib/copilot/help_fr/translation cft 2_4.log ?... Y-rw-r -- 1 cft ftpgrp 25111 Jan 22 2009/home/*******/copilot/help_fr/translation cft 2_4.logls-l/home/cft/ mftlog/cftmonitor. log ?... # Find/-type f-name "*. log "-print | xargs-p ls-l/confi ***** sist. log/etc/tunables/lastboot. log/home/*****/copilot/help_fr/translation cft 2_4.log/home/cft/*****/cftmonitor. log/home/cft/*****/cronclear_20120621.log/home/cft/*****/cronclear_20120622.log/home/cft/***/cronclear_20120623.log ..................... ....................................... /Home/***/dba/dbload/oracle/ctl/tbl_user_inf.log ?... -N can specify the number of inputs to run the subsequent command once. Therefore, when n is set to 1, the effect is the same as that of-I. In this way, some command parameters require a single input. Example: view the properties of the optical fiber card connecting to 8000: XXXXX: root: /> datapath query adapter | grep fscsi | awk '{print $2}' | xargs-n 1 lsattr-Elattach switch How this adapter is CONNECTED Falsedyntrk yes Dynamic Tracking of FC Devices truefc_err_refast_fail FC Fabric Event Error RECOVERY Policy Truescsi_id 0x140c00 Adapter scsi id limit 3 FC Class for Fabric Trueattach switch How this adapter is CONNECTED limit yes Dynamic Tracking of FC Devices limit fast_fail FC Fabric Event Error RECOVERY Policy Truescsi_id 0x20c00 Adapter scsi id Falsesw_fc_class 3 FC Class for Fabric True
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.