Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Peter Cooperx http://www.petercooper.co.uk/

« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS 

Find all large files on a Linux machine

Finds all files over 20,000KB (roughly 20MB) in size and presents their names and size in a human readable format:

find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' 

Get a list of big files on an Ensim shared hosting server

Go to /home/virtual and run:

find -type l -maxdepth 1 -name '*.*' | xargs -n 1 basename | xargs -i find /home/virtual/{}/var/www -type f -size +8192k -ls

Complex file copy

find *.orig.jpg | perl -p -e 's/\n//; $x = $_; s/\.orig/\.large/; $_ = "cp " . $x . " " . $_ . "\n"'


Would have used the basename | xargs method covered here, but the filenames were odd.
« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS