On Sunday 23 September 2007 19:22, Arie Reynaldi Z wrote:
Hi All,
I have samba file server that uses as file-sharing (mostly mp3). Right now I want to know which file (mp3) that have been accessed (read), not changed.. So I can delete all music files that stay too long but not played for a long time.. How can I do it ? I try 'ls -lat' .. buat I guess it said which file that have been changed / writed /edited. right ?
Each file in a Unix / Linux file system records three time-stamps for each file it holds: - Modify time The most recent time the file's contents were changed - Read time The most recent time the file's contents were read - Change time The most recent time the file's metadata was changed; This includes the file's owner, group, permissions (mode) _and_ its modify and read times. Each of these times is accessible via the stat family of system calls and through various command-line tools, such as ls, find and getfattr, among others. If you're goal is to enumerate files that have been read within some time range, the "find" command is probably the best tool. Read the manual page to find out how to select files based on their access times. Note, too, that any command that reads a file (cp, less, file, zip, tar and many, many others) will alter the access time. Even backup software (poorly written backup software!) can alter the access time of files it saves.
regards,
-- Arie Reynaldi Zanahar
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org