I have a directory in my webserver that has 116 thousand cookie files in it.
How do I delete them?
rm -r /var/www/html/secured/cookies/*
I tried this but it does not work.
-bash: /bin/rm/: Argument list too long
That is the error given.
I have a directory in my webserver that has 116 thousand cookie files in it.
How do I delete them?
rm -r /var/www/html/secured/cookies/*
I tried this but it does not work.
-bash: /bin/rm/: Argument list too long
That is the error given.
find /var/www/html/secured/cookies -type f -delete
Or something with xargs, but I prefer the find command..
Unless you have hidden (dot) files you want to save, just remove the whole folder
rm -r /var/www/html/secured/cookies
Then, if needed, recreate it
mkdir /var/www/html/secured/cookies
ls -f | xargs rmwill be faster than find. The -f option disables the sort (shell globbing always sorts; ls usually does) – mpez0 Jan 04 '15 at 01:42