[CentOS] how to tell if a file is older than 30 days?
Robert
kerplop at sbcglobal.netThu Sep 15 16:39:39 UTC 2005
- Previous message: [CentOS] Re: how to tell if a file is older than 30 days? -- [practices] find -mtime usage
- Next message: [CentOS] Can someone point me in the direction of a quick postfix/fetchmail setup example?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Jerry Geis wrote: > I am trying to find out how to tell if a given file is 30 days or older. > How is that type of thing done in shell scripts. > > Thanks, > > Jerry As with all things *nix, there is more than one way to do the job. You might start with this idea -- or not. If you wanted to list all files in the current directory over 29 days old (you said "30 or older) this would do it: $ find . -ctime +29 -print --OR-- those older than 29 days in your home directory $ find ~ -ctime +29 -print --OR-- to discover older rpms in the yum cache $ find /var/cache/yum -ctime +29 -print | grep .rpm Man find is your friend. Don't be overwhelmed by its many options; start simple and build up to your goal. > >------------------------------------------------------------------------ > >_______________________________________________ >CentOS mailing list >CentOS at centos.org >http://lists.centos.org/mailman/listinfo/centos > >
- Previous message: [CentOS] Re: how to tell if a file is older than 30 days? -- [practices] find -mtime usage
- Next message: [CentOS] Can someone point me in the direction of a quick postfix/fetchmail setup example?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list