LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-05-2012, 01:14 AM   #1
mzh
Member
 
Registered: Apr 2011
Location: Copenhagen
Posts: 71

Rep: Reputation: 0
Bash ls -l dir_* lists content of directories


Dear Forum
I happen to have a number of directories, labelled with specific prefixes like "opt_", "ana_", "test_" and so on. The name root of the directory could then be "single", "double", "triple", and so on (referring to some background calculation method). What I would then like to to is to list all, say, "opt_" directories. Thus I was expecting
Code:
bash $ ls -l opt_*
opt_single
opt_double
opt_triple
allowing me to see which calculation has an "opt_"directory, and which one still requires it.
However, using the above command, what happens is that not the directories, but the content of those directories is listed, which are hundreds of files, so I cant do the check I was trying to do.

How do I correctly do this? I cant figure it out.
Thanks for any helps.
 
Old 03-05-2012, 01:23 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Take a look at the man page for ls (man ls) there are lots of options to control how ls behaves.

The option you are looking for is '-d'
 
Old 03-05-2012, 01:32 AM   #3
mzh
Member
 
Registered: Apr 2011
Location: Copenhagen
Posts: 71

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Dark_Helmet View Post
Take a look at the man page for ls (man ls) there are lots of options to control how ls behaves.

The option you are looking for is '-d'
cool, true. Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Copy content of two directories x111 Linux - Newbie 6 09-22-2010 11:36 AM
LXer: Unique Sorting Of Lists And Lists Of Lists With Perl For Linux Or Unix LXer Syndicated Linux News 0 09-05-2008 01:50 PM
RHEL4 : Backup directories without content IanSolo666 Linux - Enterprise 4 03-27-2008 02:54 AM
Access Control lists on directories riteshsarraf Linux - Security 0 10-22-2002 06:25 AM
How does one delete directories with content as the SU? Ferrell Ramey Linux - General 2 08-22-2002 07:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration