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

Re: trying to find a path/file...



2009/7/9 bruce <bedouglas earthlink net>:
> never mind!!
>
> arrggh.. figured it out... you can use the path, followed by the time, and
> the name...
>
> kind of like...
>
> find /foo  -name "*.tz* -cmin -200
>
> which gets the targeted file...

find can be very picky about the syntax. The flag -name matches the
file name exactly, so matching a file can be tricky. It however
accepts file globs, so something like '-name \*.txt' is usually
effective. Its safer to escape the asterisk. You can use other options
like -mmin or -amin to find by modification time or access time.

find with -exec or find -print0 with xargs -0 are my favourite set of
commands, after all find forms the backend for almost any search
functionality in most *nix apps (e.g. search in Nautilus) :)

-- 
Suvayu

Open source is the future. It sets us free.


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