Skip to content

Instantly share code, notes, and snippets.

@ebouchut
Created November 21, 2014 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebouchut/53610a63cb6e6e79c386 to your computer and use it in GitHub Desktop.
Save ebouchut/53610a63cb6e6e79c386 to your computer and use it in GitHub Desktop.
Remove files whose name contain a space using find and xargs
# I use find -print0 and xargs -0 when the filenames contain characters used as delimitors,
# like space in this case
#
find '/tmp/temp results' -name '*.tmp' -print0 | xargs -0 -n 1 -J % rm '%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment