Operating System - HP-UX
1753587 Members
6560 Online
108796 Solutions
New Discussion юеВ

Re: finding the old files with the time stamp

 
SOLVED
Go to solution
gany59
Regular Advisor

finding the old files with the time stamp

how to know when was the file is last accessed and the file created date and time. some old files are reside in the the /opt directory. so how to find out the last 30 days unaccessed files and last 30 days created file..

Thanks in advance !!!!!!

5 REPLIES 5
R.K. #
Honored Contributor

Re: finding the old files with the time stamp

Hi Gany,

To see files that are older than 30 days since their last modification, in descending order

# find /path -xdev -type f -mtime +30 -exec ls -l {} \+ | sort -k5,5 -nr

I do not think we can get file creation time.
Don't fix what ain't broke
Johnson Punniyalingam
Honored Contributor
Solution

Re: finding the old files with the time stamp

/opt directory - One of the operating system file system were you application data's may also resides under it, better not to touch unless you sure that some of the application logs if you are willing to clean them ?

you can use find command => to check last 30days

find /opt -type f -mtime +30 |xargs ll {} \; \;

man find -> more information

unaccessed file last 30 days => its pity Odd to check them :(



Problems are common to all, but attitude makes the difference
Johnson Punniyalingam
Honored Contributor

Re: finding the old files with the time stamp

what's your problem for /opt file system due have any space issue ?

hope about answers to question will helps us actually to understand your problem
Problems are common to all, but attitude makes the difference
Dineshbabu Kandallu
New Member

Re: finding the old files with the time stamp

Please assign points to the answers...
Arturo Galbiati
Esteemed Contributor

Re: finding the old files with the time stamp

find /opt -type f -mtime +30 -exec ls -l {} \+ | sort -k5,5 -nr

File creation timestamp is not available in Unix.
HTH,
Art