Skip to content
November 21, 2011 / doganay

USING OR (-o) IN FIND COMMAND

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

 

Hi,

 

You can use or option (-o) in unix find commands:

find . -name “a*” -o “b*”

and this comment retrieves a* and b* wildcarded files/dirs in current directory.

Be careful when using one or more parameters more. (-mtime, ..)

find . -name “a*” -o “b*” -mtime +1

This does not retrieve 1 day old or newer a*, b* files, it retrieves a* files; or 1 day old b* files.

So it’s better to use 2 seperate commands:

find . -name “b*” -mtime +1

find . -name “a*” -mtime +1

 

try and pray 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: