How to `ls` only one level deep?

Try this

ls -d H2*/

The -d option is supposed to list “directories only”, but by itself just lists

.

which I personally find kind of strange. The wildcard is needed to get an actual list of directories.

UPDATE: As @Philipp points out, you can do this even more concisely and without leaving bash by saying

echo H2*/

The difference is that ls will print the items on separate lines, which is often useful for piping to other functions.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)