APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS













MacOSX Skills Test

Copyright 2002,2003 A.P. Lawrence

Answers


Answer


xargs

The xargs command is designed to run another command, feeding it arguments in chunks.

If you had several thousand files in a directory, you might not be able to even list the directory with wild cards. While "find" can help (find . -name 'mywild*'), xargs is much more flexible. See the man page for details.

Because Macs are apt to have file names with spaces and other characters that Unix doesn't like, you probably want to use -print0 with find and "-0" with xargs:

find . -print0 | xargs -0 whatever

Comments /Tests/MacOSX/e0190.html


Add your comments


Next question
Return to Question q0190
Get Complete 305 Question Set