LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
 
LinkBack Search this Thread
Old 07-13-2005, 07:55 PM   #1
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora Core 8_x86 (latest git kernel)
Posts: 434

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: 45
ls -d */

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

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
Moderator
 
Registered: Nov 2004
Location: Kennesaw, GA
Distribution: Ubuntu
Posts: 8,502

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

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: 45
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: 45
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
Moderator
 
Registered: Nov 2004
Location: Kennesaw, GA
Distribution: Ubuntu
Posts: 8,502

Rep: Reputation: 110Reputation: 110
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
Trackbacks are Off
Pingbacks are On
Refbacks are 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 11:04 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration