Last Updated: February 25, 2016
·
358
· groodt

Run a shell command on files or directories with spaces

Sometimes "xargs" like funtionality is required but unfortunately (for whatever reason) some files have spaces in their paths.

"find" to the rescue:

find . -name "ALL*" -depth 1 -exec head "{}" \;

This command offers the same sort of functionality as

ls ALL* xargs head

but it works with files that have spaces in their names.