xargs 是一条Unix和类Unix操作系统的常用命令。它的作用是将参数列表转换成小块分段传递给其他命令,以避免参数列表过长的问题。
EXAMPLES
find /tmp -name core -type f -print | xargs /bin/rm -f
Find files named core in or below the directory /tmp and delete them.
Note that this will work incorrectly if there are any filenames con-
taining newlines or spaces.
find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f
Find files named core in or below the directory /tmp and delete them,
processing filenames in such a way that file or directory names con-
taining spaces or newlines are correctly handled.
cut -d: -f1 < /etc/passwd | sort | xargs echo
Generates a compact listing of all the users on the system
阅读(1278) | 评论(0) | 转发(0) |