Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-11-2005, 08:40 AM
|
#1
|
Member
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263
Rep:
|
How to I flag 'ls' to list only the current sub-directories?
Feel I should know this...
Dave
|
|
|
01-11-2005, 10:29 AM
|
#2
|
Member
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507
Rep:
|
I don't know of an ls flag that will do it but this should work...
ls -AF | grep \/
or
find . -maxdepth 1 -type d
John
|
|
|
01-11-2005, 11:02 AM
|
#3
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
Just in case there are hidden directories, you might use this: ls -d .*"/" *"/"
|
|
|
01-13-2005, 02:35 AM
|
#4
|
Member
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263
Original Poster
Rep:
|
Thanks folks - thought there might be a more shorthand way I was missing...! ;-)
Dave
|
|
|
01-13-2005, 04:48 AM
|
#5
|
Member
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507
Rep:
|
If it's something you need to do a lot you can always make an alias...
In tcsh...
alias lss 'ls -AF | grep \/'
Where "lss" can be anything you like.
John
|
|
|
01-18-2005, 09:49 AM
|
#6
|
Member
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263
Original Poster
Rep:
|
I've done that before on my on workstation, but when I have to add it to eight AIX boxes, three Lunux servers, etc, etc, etc it becomes a bit of a bind remembering which one's which...
Dave ;-)
|
|
|
All times are GMT -5. The time now is 03:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|