The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find command takes a lot of time ( can I skip directories) knijjar Shell Programming and Scripting 3 08-12-2008 08:08 PM
command to list a only sub-directories mail2sant UNIX for Dummies Questions & Answers 1 05-09-2008 10:11 AM
Command for delete the directories which are older than 7 days sridhar sivakot HP-UX 1 02-15-2008 09:11 AM
moving directories to new directories on multiple servers mackdaddy07 Shell Programming and Scripting 0 04-06-2007 11:30 AM
Listing only directories in the current working directory using the "ls" command igandu UNIX for Dummies Questions & Answers 2 05-12-2006 04:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 2 votes, 4.00 average. Display Modes
  #1 (permalink)  
Old 10-18-2006
ravikirankethe ravikirankethe is offline
Registered User
  
 

Join Date: Oct 2006
Location: NewYork
Posts: 21
How to see only directories using ls command

I want to see only directory names using "ls" command. can come one suggest me to do this.
  #2 (permalink)  
Old 10-18-2006
karthikosu karthikosu is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 55
try ls -F this will give u directories with a slash(/) at the end
  #3 (permalink)  
Old 10-18-2006
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Code:
ls   -d   */
  #4 (permalink)  
Old 10-18-2006
ravikirankethe ravikirankethe is offline
Registered User
  
 

Join Date: Oct 2006
Location: NewYork
Posts: 21
Thanks !

From your input, I had figured out couple of other ways to display the
folders.

ls -F | grep /
To display just the folder names

ls -lF | grep /
To display the folder names along with the other information like:
drwx------ 4 u956121 ezdev 512 Nov 15 2005 Mail/
drwxrwxrwx 2 u956121 ezdev 512 Jun 2 13:19 bin/
  #5 (permalink)  
Old 10-18-2006
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,116
Code:
ls -l | sed -n '/^d/p'
  #6 (permalink)  
Old 10-19-2006
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
  
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
Code:
ls -l | grep "^d"
  #7 (permalink)  
Old 11-13-2006
mervin2006 mervin2006 is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 15
using awk..

ls -ltr | awk '/^d/'
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0