Skip to main content

Thread: Is there a command to delete all small files in a specified folder?


for example, there folder call "data" in home directory. if want delete files smaller 20kb in "data" folder (including sub-folders), parameter of mv command should run?

code:
rm `find /home/some/folder/ -size -20k -type f`
you may want run find command first see you're looking @ deleting before it.
code:
ls -lah `find /home/some/folder/ -size -20k -type f`
the -name option of find if want delete files *.jpg or something.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Installation & Upgrades [all variants] Is there a command to delete all small files in a specified folder?


Ubuntu

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support