Reputation: 1
I am trying to copy all empty files from the home directory into a folder that is on the desktop, using this:
find ~ -empty -exec cp {} /desktop/emptyfolder \;
However, I can't make it work.
Are there any other possible solutions to achieve this? Or maybe to write a bash script that could do this?
Upvotes: 0
Views: 469
Reputation: 12877
Add -type f to the find command to force it to search for files and not directories and so:
find ~ -empty -type f -exec cp {} /desktop/emptyfolder \;
Upvotes: 1