LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ls question: how to avoid listing contents of subdirectories (https://www.linuxquestions.org/questions/linux-newbie-8/ls-question-how-to-avoid-listing-contents-of-subdirectories-299573/)

learnfast 03-09-2005 08:45 AM

ls question: how to avoid listing contents of subdirectories
 
when I type:

ls -al x*

I get not only the files that start with "x" but also the DIRECTORIES that begin with "x" AND their contents.

How can I just get the files and directories (as in MS-DOS: dir x*)

thanks.

learnfast 03-09-2005 08:49 AM

let me answer my own question (from man ls)

ls -ald s*

works like in ms-dos

learnfast 03-09-2005 08:59 AM

ok, THIS may work fine:

ls -ald s*

but if I type:

ls -ald

thinking that I am going to get ALL files and directories, it only lists:

.

it only works if I type:

ls -ald *

odd, but ok.


All times are GMT -5. The time now is 10:41 AM.