Dealing with spaces when using find with exec

To prevent problems with spaces in filenames when running the ‘find’ command with -exec, use double quotes:

find . -type f -name "*.html" -exec grep ls "{}" \;

Last modified: 09/11/2011 Tags: ,

Go to top

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top