05-25-2010
ctime == last time the inode changed - ie., chmod, chown, etc.
atime == last time the file was read
mtime == last time the file was written, or open append and closed without writing.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
:D i have a slight problem and would appreciate if someone could clarify the confusion.. i use find alot and so far i have done ok.. but it just struck me a couple of days ago that I am not quite sure what the difference between the modification time and the change time as in ctime and mtime and... (3 Replies)
Discussion started by: moxxx68
3 Replies
2. UNIX for Dummies Questions & Answers
i have used all forms of the unix find command.. and right now this is the only command i can think of that might have this option..:
if i use mtime i am looking at a time interval.. but if i wanted to find out intervals of access, change and modification according to when a file changed size... (4 Replies)
Discussion started by: moxxx68
4 Replies
3. Programming
Hey,
First of all I want to know How do I see the atime of a file ?? Whats the command ??
I think ls -l shows the last modified time right ? Because when I use cat to read a file, the timestamp shown by ls -l does not change.
Its not ls -lu ! man ls did not help ! How do I see the last... (8 Replies)
Discussion started by: tantric
8 Replies
4. Tips and Tutorials
Unix keeps 3 timestamps for each file: mtime, ctime, and atime. Most people seem to understand atime (access time), it is when the file was last read. There does seem to be some confusion between mtime and ctime though. ctime is the inode change time while mtime is the file modification time. ... (2 Replies)
Discussion started by: Perderabo
2 Replies
5. Shell Programming and Scripting
Can any one tell me how to find out ctime , mtime ,atime for a file/directory on unix.
Cheers,
Nilesh (5 Replies)
Discussion started by: nilesrex
5 Replies
6. UNIX for Dummies Questions & Answers
Hi
I've made some test with perl script to learn more about mtime...
So, my question is :
Why the mtime from findfind /usr/local/sbin -ctime -1 -mtime -1 \( -name "*.log" -o -name "*.gz" \) -print are not the same as mtime from unix/linux in ls -ltr or in stat() function in perl : stat -... (2 Replies)
Discussion started by: hiddenshadow
2 Replies
7. UNIX for Dummies Questions & Answers
I need to sort through a volume that contains video files by access time and delete files that have not been accessed over x days. I have to use the access time as video files are originals that do not get modified, just read
Testing commands on a local test folder...
$ date
Wed Sep 28... (10 Replies)
Discussion started by: canon273
10 Replies
8. UNIX for Advanced & Expert Users
Hi,
ctime is the inode change time. If reading a file, its atime will be updated, which should cause inode member i_atime changed, which is an inode change. So ctime should also be updated. But if I try to ls a directory on redhat, only the directory atime gets updated, not ctime. Why?
THANKS! (2 Replies)
Discussion started by: password636
2 Replies
9. UNIX for Dummies Questions & Answers
commands ls -l or just l displays ctime (changed time) or mtime (modified time)? (10 Replies)
Discussion started by: rupeshkp728
10 Replies
10. Solaris
It is widely documented that on zfs atime updates the access time on zfs.
Where is the access time updated on Solaris 11.2?
If I create file atimetest.txt under rpool/export/home:
# zfs list rpool/export/home
NAME USED AVAIL REFER MOUNTPOINT
rpool/export/home 13.3G ... (5 Replies)
Discussion started by: jabberwocky
5 Replies
LEARN ABOUT REDHAT
tmpwatch
TMPWATCH(8) System Administrator's Manual TMPWATCH(8)
NAME
tmpwatch - removes files which haven't been accessed for a period of time
SYNOPSIS
tmpwatch [-u|-m|-c] [-faqstv] [--verbose] [--force] [--all] [--test]
[--fuser ] [--atime|--mtime|--ctime] [--quiet] <hours> <dirs>
DESCRIPTION
tmpwatch recursively removes files which haven't been accessed for a given number of hours. Normally, it's used to clean up directories
which are used for temporary holding space such as /tmp.
When changing directories, tmpwatch is very sensitive to possible race conditions and will exit with an error if one is detected. It does
not follow symbolic links in the directories it's cleaning (even if a symbolic link is given as its argument), will not switch filesystems,
and only removes empty directories and regular files.
By default, tmpwatch dates files by their atime (access time), not their mtime (modification time). If files aren't being removed when ls
-l implies they should be, use ls -u to examine their atime to see if that explains the problem.
If the --atime, --ctime or --mtime options are used in combination, the decision about deleting a file will be based on the maximum of this
times.
The hours parameter defines the threshold for removing files. If the file has not been accessed for hours hours, the file is removed. Fol-
lowing this, one or more directories may be given for tmpwatch to clean up.
OPTIONS
-u, --atime
Make the decision about deleting a file based on the file's atime (access time). This is the default.
-m, --mtime
Make the decision about deleting a file based on the file's mtime (modification time) instead of the atime.
-c, --ctime
Make the decision about deleting a file based on the file's ctime (inode change time) instead of the atime; for directories, make
the decision based on the mtime.
-a, --all
Remove all file types, not just regular files and directories.
-d, --nodirs
Do not attempt to remove directories, even if they are empty.
-f, --force
Remove files even if root doesn't have write access (akin to rm -f).
-t, --test
Doesn't remove files, but goes through the motions of removing them. This implies -v.
-s, --fuser
Attempt to use the "fuser" command to see if a file is already open before removing it. Not enabled by default. Does help in some
circumstances, but not all. Dependent on fuser being installed in /sbin.
-v, --verbose
Print a verbose display. Two levels of verboseness are available -- use this option twice to get the most verbose output.
SEE ALSO
cron(1), ls(1), rm(1), fuser(1)
WARNINGS
GNU-style long options are not supported on HP-UX.
AUTHORS
Erik Troan <ewt@redhat.com>
Preston Brown <pbrown@redhat.com>
Nalin Dahyabhai <nalin@redhat.com>
4th Berkeley Distribution Wed Nov 28 2001 TMPWATCH(8)