I'm trying to use find to list dirs with a certain file inside, but my dirs have spaces so I haven't found a solution.
feedback
|
migrated from serverfault.com Apr 22 '11 at 10:31
This question came from our site for system administrators and desktop support professionals.
|
Assuming I'm really understanding your question, have you tried:
This works for me even if my directories have spaces:
| |||
feedback
|
|
This is from the fedora .bashrc file:
Add this to your now you can use The | |||
|
feedback
|
|
POSIX dictates a rather weak
Note that you'll also need to escape quotes and backslashes, if you have directories that include these. This could replace the sed command:
(Note the extra backslashes on the double quoted script. Single quote strings use backslashes literally, but double quote strings will interpret backslashes, thus your shell will interpret If you can use the X/Open System Interface extensions, then the first version (no quotes or backslashes) simplifies to:
If you have quotes and backslashes in your directory names, these will still need to be escaped as above (but without escaping spaces). Either way, if you have newlines in your directory names, then you've got bigger problems than I can help with. Edited to remove bash version, cleaned up based on input from Dennis Williamson | |||||||
feedback
|
|
Or even:
| |||
|
feedback
|