You can receive the error argument list too long trying to execute a rm -f * in a directory with a lot of files but there is a very simple workaround. Simply execute this instead to delete the files…
find . -name "*" -type f -maxdepth 1 -exec rm {} \;
Important: Executing a find . -exec rm {} \; is equivalent to executing a rm -f * — be sure you know what you are doing and be sure you are in the right directory when you execute this.
Note that the -name "*" switch avoids deleting system files and the -maxdepth 1 switch avoids deleting files in subdirectories.
Note that there’s a difference between the two. The workaround you present will delete hidden files (those that start with a dot) and the content of any folders in the directory you’re deleting from, while the original will not.
If you’re okay with that, a simpler workaround would simply be to delete the directory containing the files you want to delete.
Excellent clarification, thanks. I’ve changed to avoid recursing into subdirectories.
….
Я извиняюсь, но, по-моему, Вы не правы. Я уверен. Давайте обсудим. Пишите мне в PM….
Buy:Viagra Soft Tabs.Cialis Professional.Viagra Super Active+.Cialis.Viagra Super Force.Viagra Professional.Cialis Soft Tabs.Maxaman.Propecia.Cialis Super Active+.Super Active ED Pack.Levitra.VPXL.Viagra.Tramadol.Soma.Zithromax….