The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to view my IP blowFish@ubuntu UNIX for Dummies Questions & Answers 14 05-09-2008 06:35 AM
Listing directories and sub directories jinxor UNIX for Advanced & Expert Users 3 03-11-2008 06:27 AM
moving directories to new directories on multiple servers mackdaddy07 Shell Programming and Scripting 0 04-06-2007 08:30 AM
view all others terminals vkandati UNIX for Dummies Questions & Answers 2 03-08-2005 03:27 PM
DBM View schafferm UNIX for Dummies Questions & Answers 1 08-06-2002 01:18 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-05-2006
Registered User
 

Join Date: Dec 2005
Posts: 33
Stumble this Post!
cmd to view only directories

Hi All,

Plz tell me the cmd of viewing only directories. Suppose i am at bin directory and it contains another directory mails with lotz of files in it.

Now when ever I do ls -lt mails under bin directory it shows me all the files inside mails dir . But I just want to see only mails dir as an output not all of its contents(i.e files inside mails dir). Is there any switch for displaying directories only.

Plz let me know. I would be thankful. I am working on Solaris 5.8 platform.


Thnx..
Aru
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-05-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,795
Stumble this Post!
If I understand your questions try:
Code:
ls .
This gives the files that live in the current directory, including the names of directories but not the files in those directories.
Reply With Quote
  #3 (permalink)  
Old 04-05-2006
Registered User
 

Join Date: Mar 2006
Location: Mumbai,India
Posts: 57
Stumble this Post!
ls -d */

Only list the directories in the current directory

cheers

swapneel
Reply With Quote
  #4 (permalink)  
Old 04-05-2006
Registered User
 

Join Date: Mar 2006
Location: Mumbai,India
Posts: 57
Stumble this Post!
ls -d */

Only list the directories in the current directory

cheers

swapneel
Reply With Quote
  #5 (permalink)  
Old 04-05-2006
Registered User
 

Join Date: Dec 2005
Posts: 33
Stumble this Post!
Dear friend thanks for reply. I have tried uising ls -d */ but its giving me following error

$ ls -d */
*/: No such file or directory

But there are few directories in bin folder. Please suggest some other solution.

Aru.
Reply With Quote
  #6 (permalink)  
Old 04-05-2006
Registered User
 

Join Date: Mar 2006
Location: Mumbai,India
Posts: 57
Stumble this Post!
hi

try ls */

or

visit this page http://www.computerhope.com/unix/uls.htm
and have a look at directoy of file

Cheers

Swapneel
Reply With Quote
  #7 (permalink)  
Old 04-05-2006
Registered User
 

Join Date: Dec 2005
Location: Pune
Posts: 78
Stumble this Post!
try
ls -l|grep ^d
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0