On Linux or Unix systems perform recursively a command on items might contain white space, quote marks, or backslashes can be a problem when using find | xargs combination.
To solve this you may use:
find -type d -print0 | xargs -0 <command> find -type f -print0 | xargs -0 <command>
For example to fix recursively permission:
find -type d -print0 | xargs -0 chmod 755 find -type f -print0 | xargs -0 chmod 644
Tags: bash, linux, Linux/Unix
-
Pingback from Recent Links Tagged With "xargs" - JabberTags on October 31, 2008 at 3:49 am

1 comment
Comments feed for this article
Trackback link: http://lucasforge.bmeme.com/2008/05/execute-commands-on-folder-and-files-containing-spaces/trackback/