Operating System - Linux
1827791 Members
2508 Online
109969 Solutions
New Discussion

Re: Checking if file's modification and access time is changed

 
Danny Fang
Frequent Advisor

Checking if file's modification and access time is changed

Hi,
May I know what is the command to check if a particular file has had its access and modification time changed in a Red Hat 8?

Thanks
Danny



3 REPLIES 3
RAC_1
Honored Contributor

Re: Checking if file's modification and access time is changed

Check the options to ls command. On other unix flavors, following can be done and I am sure you have equivalent ls options on redhat.

ls -cl -> shows chnage time
ls -ul -> shows access time
ls -tl -> shows modification time.

There is also a tripwire tool with which you can get what you want and many more things.

Anil
There is no substitute to HARDWORK
Stuart Browne
Honored Contributor

Re: Checking if file's modification and access time is changed

Try the command 'stat '.

It should return an output similar to:

File: `ping.log'
Size: 2330542 Blocks: 4560 IO Block: 4096 regular file
Device: 303h/771d Inode: 505030 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2005-05-04 16:38:47.000000000 +1000
Modify: 2004-07-13 14:13:37.000000000 +1000
Change: 2004-07-13 14:13:37.000000000 +1000

Shows access, modification/change time.
One long-haired git at your service...
Gopi Sekar
Honored Contributor

Re: Checking if file's modification and access time is changed


ls -clt will give a long list of files sorted based on their modification time(latest one at the top)

ls -ult will give list of files sorted based on their access time (latest one at the top)

for more info on ls check 'man ls'

also you can use find command to get list of files which are modified/acccessed with in the specified time frame.

check amin, atime, cmin, ctime options of find command, check man find

Gopi
Never Never Never Giveup