Archives | Blog (January-2010-21)
Back to: Blog
Thursday, 21. january 2010.
Find files larger than X and delete them in Mac OS/Unix terminal
Another terminal oneliner I've just used to delete files larger than 10mb.
So if you need to delete some files larger than X mb on your Mac or some unix server, here is the simple oneliner to do it, in this example we're looking for files larger than 10mb in current folder (and subfolders, because find command is recursive) and delete them:
find ./ -size +10000000c -exec rm {} \;
And to be sure that you'll be deleting the right files, you can first list them like this:
find ./ -size +10000000c -exec ls -la {} \;
bananica.com | Branko Jevtić's piece of web
RSS feed
Recent posts
- Thursday, 21. january 2010. Find files larger than X and delete them in Mac OS/Unix terminal
- Tuesday, 15. december 2009. Bananica.com - Finally!
- Monday, 14. december 2009. MySQL Find and Replace with helper tool that generates SQL for you
- Monday, 14. december 2009. Synchronize two folders on a Mac with Automator and Rsync
- Monday, 14. december 2009. Synchronize two folders on a Mac and other Unix Systems with Rsync
- Sunday, 13. december 2009. Add all new files and folders to subversion with one line in terminal
Recent comments
-
Wednesday, 24. february 2010. karol commented on Add all new files and folders to subversion with one line in terminal Great! However, this doesn't work if your file names contain spaces.
I managed to compile several snippets from the net and came up with this:
svn status | grep "^?" | awk '{$1="";$0=substr($0,2)}1' | sed -e "s,[^.],\'&," -e "s,\$,\'," | xargs svn add
Phew! Works in Snow Leopard. - Tuesday, 23. february 2010. eMancu commented on Synchronize two folders on a Mac and other Unix Systems with Rsync Thanks a lot! I was looking for --delete example :)
-
Wednesday, 13. january 2010. annmarie commented on Ambium Ja, meni je moja spletna stran noro dobra. Na svetovnem nivoju, ni kaj.