I tried to delete a few thousands files with one
rm cache_*
command. But it returned error message that 'Argument list too long'. Can you advice how to resolve this issue?
How to delete a huge quant of files at once
(2 posts) (2 voices)-
Posted 1 year ago #
-
This trick will help
find . -maxdepth 1 -name 'cache_*' -exec rm {} \;This way 'rm' command will delete files one by one according to 'find' command search results. If you wish to delete all files in the directory tree at the current '.' directory remove '-maxdepth 1' option from 'find' command.
This variant will help also
ls cache_* | xargs rm
Posted 1 year ago #
Reply
You must log in to post.