Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-27-2007, 02:19 AM   #1
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
Question how to find files in current directory only (not recursively)

how to find the files using find command in current directory only without searching recursively inside the directories.
Old 12-27-2007, 02:23 AM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,265

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
I think setting -maxdepth 1 should do it, if I understand your question correctly.
Old 12-27-2007, 02:30 AM   #3
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30

it works but i dont understand the output when -maxdepth is set to zero

[bala@localhost ~]$ find -maxdepth 0

what does the . (current directory ) signify.i expect the output to be nothing.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to recursively delete *.xtension files from a directory structure kpachopoulos Linux - General 6 08-24-2008 09:53 AM
find lists current directory kaprasanna Linux - General 3 12-17-2007 05:06 AM
find in current directory ramanadyv Linux - Newbie 3 03-28-2006 11:12 PM
How to recursively rename files using their directory name pattern ceg4048 Linux - General 2 09-28-2005 02:16 PM
how do I find out the current working directory? nodger Programming 2 12-26-2004 12:28 PM

All times are GMT -5. The time now is 01:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration