Review your favorite Linux distribution.
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 05-14-2007, 01:41 PM   #1
LQ Newbie
Registered: Feb 2007
Posts: 13

Rep: Reputation: 0
linux command to display only directories

anyone please tell me the linux command to display only the directories.(any options with ls or something like that...)
Old 05-14-2007, 02:06 PM   #2
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 448

Rep: Reputation: 37
This is a nice thread with some suggestions.
Old 05-14-2007, 05:22 PM   #3
Registered: Dec 2006
Distribution: Debian (Wheeze)
Posts: 391

Rep: Reputation: Disabled
Have you tried ls -d.
Old 05-15-2007, 03:57 AM   #4
LQ Newbie
Registered: May 2007
Location: Bangalore
Distribution: Arch
Posts: 6

Rep: Reputation: 0
ls -l | grep ^d
This will do.....
Old 05-15-2007, 04:52 AM   #5
Registered: Dec 2006
Distribution: Debian (Wheeze)
Posts: 391

Rep: Reputation: Disabled
You could also do dir which would give you a list of all files an directpries.


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
directories first in ls display? gjhicks Linux - Newbie 9 07-15-2009 12:51 PM
Linux Command login screen, Display Script? roclok Linux - Software 2 06-14-2006 12:22 AM
linux command : read/display the line n xeebeeeeeee Programming 3 03-26-2006 05:08 AM
I want ls to not display contents of directories GameboyHippo Linux - Newbie 2 01-26-2004 03:47 AM
Display wide listing of files and directories only? northfield Linux - General 3 08-21-2002 06:28 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:37 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