Tag Archives: atime

Use awk to calculate total size of files – part 1

Your boss came to you and asked for total size of files which has not been accessed for more than 30 days! Assume that you are just checking for 1 directory “/abc” . Here comes the simple command: find /abc -atime +30 -exec ls -lk ‘{}’ \;  | awk ‘{SUM += $5} END {print SUM} ‘ Explaination: find /abc -atime +30 -exec ls -lk ‘{}’ \ find command will find /abc and check for accestime which has not been access … Continue reading

Posted in Linux | Tagged , , | 1 Comment