LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bash ls -l dir_* lists content of directories (https://www.linuxquestions.org/questions/linux-general-1/bash-ls-l-dir_%2A-lists-content-of-directories-932756/)

mzh 03-05-2012 01:14 AM

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.

Dark_Helmet 03-05-2012 01:23 AM

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'

mzh 03-05-2012 01:32 AM

Quote:

Originally Posted by Dark_Helmet (Post 4618654)
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


All times are GMT -5. The time now is 09:39 AM.