LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-21-2016, 08:05 AM   #16
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,633
Blog Entries: 4

Rep: Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931

ummm... If you only want to search the current directory, why not use ls?
 
2 members found this post helpful.
Old 06-21-2016, 10:28 AM   #17
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,606

Rep: Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960Reputation: 7960
Cool

Quote:
Originally Posted by techie_san778 View Post
Yes Pingu, it does the job. Thanks for the solution mate.
You mean, the solution TenTenths gave you in post #2, and which Habitual gave you in post #3???? The same "maxdepth" flags??? Then you got sarcastic with your "busy boy" comments...and go on to use that same solution, and thank someone else??

Nice. And sundialsvcs asked (rightly so), why you can't use ls, if you only want to search the current directory?
 
1 members found this post helpful.
Old 06-21-2016, 11:41 AM   #18
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by techie_san778 View Post
I wanted to know that whether find command can be made to search non-recursively, i.e.
within a directory only, not inside it's sub-directories.
That having said, i came to know that the "maxdepth" is not POSIX compliant. So, i was trying out the "prune" option, but i am unable to find the hidden files & directories.
Can you suggest a solution ?
try

find . -path './*' -prune -name '.*'

This will give you all the hidden files and directories in the current directory.

Brian

Last edited by BCarey; 06-21-2016 at 11:43 AM.
 
  


Reply


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
Find current Thunar directory from CLI? jsteel Linux - General 3 04-21-2011 02:05 AM
[SOLVED] How to find files under the current directory? thomas2004ch Linux - Newbie 2 10-05-2010 05:19 AM
find lists current directory kaprasanna Linux - General 3 12-17-2007 04:06 AM
find in current directory ramanadyv Linux - Newbie 3 03-28-2006 10:12 PM
how do I find out the current working directory? nodger Programming 2 12-26-2004 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:38 PM.

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