As in the title, I would like to remove all files in the
lib directory with
.swp in the end.
How can I do this without
rm `find lib/ -name *.swp`
The benefit to find is that it is recursive. Some modern shells offer search recursion, but it is not in the POSIX standard, so you can not rely on them to work everywhere. Here is an example that works in bash 4.0 and higher.
As far as the find command that you already have, it will break on any files that contain whitespace such as spaces. Here is a fixed example:
With some versions of
As for your original, I'd have done it:
You might also want to use
|show 4 more comments|