![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 05:08 PM |
| command to list a only sub-directories | mail2sant | UNIX for Dummies Questions & Answers | 1 | 05-09-2008 07:11 AM |
| Command for delete the directories which are older than 7 days | sridhar sivakot | HP-UX | 1 | 02-15-2008 06:11 AM |
| moving directories to new directories on multiple servers | mackdaddy07 | Shell Programming and Scripting | 0 | 04-06-2007 08:30 AM |
| Listing only directories in the current working directory using the "ls" command | igandu | UNIX for Dummies Questions & Answers | 2 | 05-12-2006 01:47 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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.
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
try ls -F this will give u directories with a slash(/) at the end
|
|
#3
|
|||
|
|||
|
Code:
ls -d */ |
|
#4
|
|||
|
|||
|
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
|
||||
|
||||
|
Code:
ls -l | sed -n '/^d/p' |
|
#6
|
||||
|
||||
|
Code:
ls -l | grep "^d" |
|
#7
|
|||
|
|||
|
using awk..
ls -ltr | awk '/^d/'
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|