nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

UNIX ls only directories (display only dirs and no files)

This is a discussion on UNIX ls only directories (display only dirs and no files) within the Solaris/OpenSolaris forums, part of the UNIX operating systems category; Hi How do i display only dirs and no files thanks in advance...


Go Back   nixCraft Linux Forum > UNIX operating systems > Solaris/OpenSolaris

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 10-20-2006, 03:43 AM
Member
User
 
Join Date: Feb 2005
Posts: 66
Rep Power: 0
chiku
Default UNIX ls only directories (display only dirs and no files)

Hi

How do i display only dirs and no files

thanks in advance
__________________
There's no place like 127.0.0.1
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-21-2006, 12:27 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 481
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Use the combination of ls and grep:
Code:
ls -l | grep '^d'
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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

Similar Threads

Thread Thread Starter Forum Replies Last Post
HPUX Unix comparing 2 large files line by line raj HP-UX 1 02-11-2008 05:20 PM
take backup of all indiviudal user dirs seperately of /home veerkumar Shell scripting 4 01-15-2008 07:37 AM
UNIX Display or list number of files in a current directory raj Getting started tutorials 1 12-07-2007 10:55 AM
how to change the format of multiple files in different directories dustcloud4 Shell scripting 0 06-05-2007 03:03 AM
Linux list directories and files raj Getting started tutorials 0 05-05-2007 01:05 AM


All times are GMT +5.5. The time now is 11:06 PM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36