Can u explain:
find $hog -mtime -1 -exec ls -l {} \;
I transfered a large file just before executing script so it could be considered a growing hog within 1 day as a test (
Al.v1.4.3.410.Retail.rar)
Here is my output:
$ du -ks *|sort -nr|pg
217208 bac.tar
130664 16.1.0.30.tar
86583 ciagent_sms
3280 Al.v1.4.3.410.Retail.rar
3 test
2 house
1 test2.txt.gz
1 test2.txt
1 test1.txt
1 test.sh
1 test.csv
1 script.sh
1 private
1 one
1 hog1
1 hog.sh
1 files.tar.Z
1 dir_link
1 dead.letter
1 date.txt
1 csv_link
0 perm
$
$
HERE IT YOUR SCRIPT:
$ hog.sh
Current Hog - bac.tar (217208):
Current Hog - 16.1.0.30.tar (130664):
Current Hog - ciagent_sms (86583):
Current Hog - Al.v1.4.3.410.Retail.rar (3280):
-rw-r--r-- 1 joek staff 3344362 Jan 27 15:34 Alcohol.120%.v1.4.3.410.Retail.rar
Current Hog - test (3):
Current Hog - house (2):
Current Hog - test2.txt.gz (1):
Current Hog - test2.txt (1):
Current Hog - test1.txt (1):
Current Hog - test.sh (1):
Current Hog - test.csv (1):
Current Hog - script.sh (1):
Current Hog - private (1):
Current Hog - one (1):
Current Hog - hog1 (1):
-rw-r--r-- 1 joek staff 234 Jan 27 15:25 hog1
Current Hog - hog.sh (1):
-rwxrwxrwx 1 joek staff 224 Jan 27 15:48 hog.sh
Current Hog - files.tar.Z (1):
Current Hog - dir_link (1):
Current Hog - dead.letter (1):
-rw------- 1 joek staff 301 Jan 27 11:13 dead.letter
Current Hog - date.txt (1):
Current Hog - csv_link (1):
Current Hog - perm (0):
It looks like it works, but I would like to understand how? How does the last line work? (find $hog -mtime -1 -exec ls -l {} \
Also, when it searches for the hog for the past day could I format the output using - awk '{print $5,$NF,$6}' so it only displays column 5,6 and the last column of the "ls -l" command (size,filename, date).
I tried to insert that instead of the -exec comand with no luck.
-Thanks