After run rm -f * you get the error /bin/rm: Argument list too long
Possible options:
Use xargs. Xargs pass a list of arguments to a command. This deletes all the files listed:
ls |xargs rm
Use find. You can use the find command to make some actions with the found elements.
find . -exec rm {} \;
If you don´t remember any of the above options, always can remove the whole directory and create it again. Caution with the subfolders!
- BROWSE / IN Linux
- « Could not connect to database for SQL SessionHandler
- » Reiniciar linux sin el comando reboot
COMENTARIOS / UN COMENTARIO
Alberto de Tena 11 Apr 2008 a las 1:54 pmI’ll teach you another way that I use quite a lot for doing stuff like this.
for file in `ls`; do
rm -f $file
done
COMENTA
