use of find

Hi All,

I want to be able to find from a directory, all files that do NOT have
a ".gz" file extension and also are more than 1 day old.

The idea is to zip the resultant files.


Thanks in Advance
zmasood [ Di, 06 November 2007 00:17 ] [ ID #1863274 ]

Re: use of find

zmasood [at] gmail.com wrote:
> Hi All,
>
> I want to be able to find from a directory, all files that do NOT have
> a ".gz" file extension and also are more than 1 day old.
>
> The idea is to zip the resultant files.
>
>
> Thanks in Advance
>

See if my "find" tutorial meets your needs:

http://www.hccfl.edu/pollock/Unix/FindCmd.htm

-Wayne
wayne [ Di, 06 November 2007 04:09 ] [ ID #1863278 ]

Re: use of find

On Nov 6, 8:09 am, Wayne <nos... [at] all4me.invalid> wrote:
> zmas... [at] gmail.com wrote:
> > Hi All,
>
> > I want to be able to find from a directory, all files that do NOT have
> > a ".gz" file extension and also are more than 1 day old.
>
> > The idea is to zip the resultant files.
>
> > Thanks in Advance
>
> See if my "find" tutorial meets your needs:
>
> http://www.hccfl.edu/pollock/Unix/FindCmd.htm
>
> -Wayne

find . -name "*.gz" -ctime -1

-ctime option is for last file status change time. You can use -mtime
option for last modified time and -atime for the last accessed time
ramesh.thangamani [ Di, 06 November 2007 05:51 ] [ ID #1863282 ]

Re: use of find

rthangam wrote:
> Wayne wrote:
>> zmas... [at] gmail.com wrote:
>>>
>>> [...] find [...] all files that do NOT have
>>> a ".gz" file extension and also are more than 1 day old.
>
> find . -name "*.gz" -ctime -1

find . ! -name "*.gz" -ctime -1

--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
Cyrus Kriticos [ Di, 06 November 2007 10:17 ] [ ID #1863287 ]

Re: use of find

On Nov 6, 2:17 pm, Cyrus Kriticos <cyrus.kriti... [at] googlemail.com>
wrote:
> rthangam wrote:
> > Wayne wrote:
> >> zmas... [at] gmail.com wrote:
>
> >>> [...] find [...] all files that do NOT have
> >>> a ".gz" file extension and also are more than 1 day old.
>
> > find . -name "*.gz" -ctime -1
>
> find . ! -name "*.gz" -ctime -1
>
> --
> Best regards | Be nice to America or they'll bring democracy to
> Cyrus | your country.

Thanks Cyrus for correcting me :).
ramesh.thangamani [ Di, 06 November 2007 10:30 ] [ ID #1863289 ]
Linux » comp.unix.shell » use of find

Vorheriges Thema: mail -s does not put subject
Nächstes Thema: To edit a portion of file.