The UNIX and Linux Forums  

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
Directory inside directory problem namishtiwari Shell Programming and Scripting 6 01-27-2008 01:07 AM
unable to create any directory that uses numbers as the directory name fed.linuxgossip UNIX for Advanced & Expert Users 16 01-13-2008 05:54 PM
determining actual directory of a symlinked directory chiru_h Shell Programming and Scripting 3 09-24-2007 04:40 PM
determine owner directory permissions from within the directory Sniper Pixie Shell Programming and Scripting 4 03-07-2006 02:06 PM
moving files from a unix directory to a windows directory gleads UNIX for Dummies Questions & Answers 2 08-29-2002 05:42 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-16-2002
Registered User
 

Join Date: Jan 2002
Posts: 2
Unhappy Ls For A Directory

I know this is a easy question but I forgot how to do this?
How do I 'ls' for only the directories in a given directory. I don't want to display a recursive find for every subdirectory. I just want the simple 'ls #$%^'

Thanks
Forum Sponsor
  #2  
Old 01-16-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
list directories

I am soooo glad you asked.

Here are some aliases that I use every day.


# list of my aliases
alias dir='ls -la'

alias lt='ls -lt'

alias lrt='ls -lrt'

alias pp='ps -aef|grep'

alias lsfg='lsf |grep '\/''


Enjoy!!

__________________
My brain is your brain
  #3  
Old 01-16-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Try ls -F | grep "\/$", like above - but if you want a long listing you can do something like:
ls -l | grep ^d
  #4  
Old 01-17-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
good!

Sorry my alias was for HPUX. LivinFree's example will work on any major version of UNIX.
__________________
My brain is your brain
  #5  
Old 01-17-2002
Registered User
 

Join Date: Jan 2002
Posts: 2
Cool

Thanks to you all!

JV
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:35 PM.


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

Content Relevant URLs by vBSEO 3.2.0