[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: date problem with ls -la --time=ctime



Rainer Traut wrote:

John Haxby wrote:

Rainer Traut wrote:

Question is, what time does ls -la show?
The man page says 'change time', so ctime?



mtime -- time of last modification (write).


Thx for your fast answer, but I can only specify
status, atime, access, use and ctime.
None of them is the same as plain 'ls -la'?

There are three timestamps maintained for files: mtime (modification time), atime (access time) and ctime (change time). ctime differs from mtime in that it records a change to the file that doesn't involve changing the files contents; chmod, chown, etc affect this.


If you want to delete files in /tmp that haven't been accessed (atime, ie read) in the last 15 minutes then

find /tmp -type f -amin +15 | xargs rm -f

That's going to annoy some people if they're expecting files to hang around in /tmp for any length of time, so this is probably better

find /tmp -type f -user notes -amin +15 | grep '^/tmp/eo-[^/]*tm$' | xargs rm -f

which will restrict the files to those owned by "notes" and, further, those that match a specific pattern. Check the find(1) man page to make sure I've got +15 right: I always test it to make sure!

jch

jch


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]