| Size of folder tree | du -h .| sort -nr |
| Size of current folder (level 1) | du -d 1| sort -nr |
| Quotas | quota -v |
find . -type d -mtime +90 -exec rm -rf {} \;
du -sk .
ls -l | awk '{t+=$5}END{print t}'
ls -lR . | awk '{sum += $5} END{print sum}'
exactly the sum of ls in MB
ls -lR . | awk '{sum += $5} END{printf "%2f\n", sum/1024/1024}'
ls -al | sort -nbk5 => sort by file size
ls -lrt => sort by date/time
Get sizes of folders and subfolders
du -h --max-depth=3
or a shell script:
#/bin/sh
du -k --max-depth=1 | sort -nr | awk '
BEGIN {
split("KB,MB,GB,TB", Units, ",");
}
{
u = 1;
while ($1 >= 1024) {
$1 = $1 / 1024;
u += 1
}
$1 = sprintf("%.1f %s", $1, Units[u]);
print $0;
}
'
find . -mtime -60 (last 60 days) find . -maxdepth 1 -mtime -1 -ls (last 1 day) find . -maxdepth 1 -mtime -0.007 -ls (last 10 minutes)
find -type f -newermt 20141101 \! -newermt 20141218 mv -t <destination> `find -type f -newermt 20141101 \! -newermt 20141218`
Sort by time
ls -t ls -tr
Pipes, see here
| Append >> | cat $DATEIM >> $DATEIJ |
| Targeting > | cat $DATEIM > $DATEIJ |