The command is made up of different elements. ![]() name "*.page" -type f -print0 | xargs -0 tar -cvzf page_ ![]() We’ll run this command in a directory that has many help system PAGE files in it. This is a long-winded way to go about it, but we could feed the files found by find into xargs, which then pipes them into tar to create an archive file of those files. We can use find with xargs to some action performed on the files that are found. That’s “almost the same” thing, and not “exactly the same” thing because there can be unexpected differences with shell expansions and file name globbing. This achieves almost the same thing as straightforward piping. To address this shortcoming the xargs command can be used to parcel up piped input and to feed it into other commands as though they were command-line parameters to that command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |