LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-13-2005, 07:55 PM   #1
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Rep: Reputation: 30
showing only directorys from the command line


hello,

i'm trying to show directories from the command line, but i can't seem to find a command that does it. I know about ls -la and how it displays a "d" for the directories, but how to i display just directories. I tried messing with grep but wiht no luck, i believe i need some sort of regular expression and I'm not very good with regular expression so any help with be grateful.

thanks,

djgerbavore
 
Old 07-13-2005, 08:00 PM   #2
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
ls -d */

KC
 
Old 07-13-2005, 08:15 PM   #3
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
thanks, that helped alot, but how do i show the hidden directories that start with a dot(.)

i tried ls -d .*/ and that works but how to i show but hidden directories and regular directories?????


thanks for your help


haha i figured it out, i combined both commands and it worked

ls -d */ && ls -d .*/

works perfectly!


thanks

Last edited by djgerbavore; 07-13-2005 at 08:19 PM.
 
Old 07-13-2005, 08:19 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
Code:
ls -d .*/ */
 
Old 07-13-2005, 08:21 PM   #5
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
Matir:

i like your way alot better, thanks for the quick reply.


thanks everyone for helping me
 
Old 07-13-2005, 08:23 PM   #6
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
Hmm good ? you could use a separator but there is probably a better way... I'll have to work on that...

ls -ld .*/ ; ls -ld */

KC
 
Old 07-13-2005, 08:24 PM   #7
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
Quote:
Originally posted by Matir
Code:
ls -d .*/ */
I knew it was something simple... Thanks from both of us...

KC
 
Old 07-13-2005, 08:34 PM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
No problem.

Again, gotta love how linux provides 100,000 ways to do anything.
 
  


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
disk not showing up in 'df' command jjordan Mandriva 8 09-25-2004 09:29 PM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM
51 characters only in the 1st Line of command line eggCover Linux - General 2 07-29-2004 01:28 PM
Top command showing 2 users ShadowMan Linux - Newbie 2 08-15-2003 01:04 AM
Showing Distrobution in Command Line? dpaille Linux - General 12 11-24-2002 09:16 PM


All times are GMT -5. The time now is 12:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration