How do you find files whose names contain embedded spaces?
What would the Linux command(s) be?
How do you delete them?
What would the Linux command(s) be?
find has a -exec option, which allows you to specify a command to be executed for each file found. The executed command may also take arguments, any of which may be the string {} which will be replaced by the path of the found file. The command and its arguments are not subject to further expansion of shell patterns, so it's safe for {} to stand in for a file with a space in the name. For example,
$ find ~/Library -name '* *' -exec ls {} \;
The following command is required to copy or delete files with spaces in their name, for example:
$ cp "filename" /secure/location/ $ rm "filename"
Get Answers For Free
Most questions answered within 1 hours.