Finding files in current directory not including subdirectories

To find files in current directory bu excluding all sub-directories:

find . -name *.log -maxdepth 1 -print

if -maxdepth is not avaiable

find .  \( -name . -o -prune \) -name "*.log" -print
Advertisements
Tags: ,

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: