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_* 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. |
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' |
Quote:
|
All times are GMT -5. The time now is 09:39 AM. |