Posts Tagged: bash

Linux directory size

Posted by & filed under Linux.

To display the size of directory, including sub directories, eg, for /backup: du /backup -ch | grep total See http://www.codecoffee.com/tipsforlinux/articles/22.html

Finding large files in linux

Posted by & filed under Linux.

Here’s a bash script to do it: #!/bin/bash # if nothing is passed to the script, show usage and exit [[ -n “$1” ]] || { echo “Usage: findlarge [PATHNAME]“; exit 0 ; } # simple using find, $1 is the first variable passed to the script find $1 -type f -size +100000k -exec ls… Read more »