Link to home
Start Free TrialLog in
Avatar of softbless
softbless

asked on

Shell Script Modification, add file metadata

Hi Guys,

I have this script :
find /files/contentstore -mtime +180 > oldfilelist.txt

That script : list all files which have age more than 180 days to oldfilelist.txt.

The "oldfilelist.txt" will contain the full path of the files. For example the contain will be like this :
/var/tmp/calculate1.jpg
/var/tmp/image1.jpg
/root/usr/ben/document1.jpg
/root/view11.jpg

I need some modification to the above script, so each row in "oldfilelist.txt" will  contain :
# file name
# full path
# and modified date

With each metadata separated by tab character. So the "oldfilelist.txt" will contain like this :
calculate1.jpg         /var/tmp/calculate1.jpg         1998-01-31
image1.jpg         /var/tmp/image1.jpg         1978-12-02
document1.jpg         /root/usr/ben/document1.jpg         2010-02-28
view11.jpg         /root/view11.jpg         2009-05-18


Please help. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial