in reply to Re: Deleting old files from directory
in thread Deleting old files from directory
To handle spaces in filenames:
On first run(s), you should consider using ls -l instead of rm -f.find <directory> -type f -mtime +10 -name "*some*pattern*.txt" -exec r +m -f '{}' \;
I see you've used -ctime; here are the differences among Unix timestamps:
- Access Time (atime) - time that the file was last accessed (e.g. read)
or written to. - Modify Time (mtime) - time the actual contents of the file were last modified.
- Change Time (ctime) - the time that the inode information (permissions, name, etc., i.e. the metadata) was last modified.
Update: atime info corrected; for more see man 2 stat.
Have a nice day, j
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Deleting old files from directory
by chrestomanci (Priest) on Sep 28, 2011 at 08:57 UTC |
In Section
Seekers of Perl Wisdom