FG

The command 'ls -d' is not displaying directories. Is there a way to get 'ls' to only display directories instead of files and directories?

Fresh3 days ago
Mar 15, 202671019 views
Confidence Score0%
0%

Problem

Is there a way to get to only display directories instead of files and directories? From the man page: So if I type it at the directory I expect to see only directories. Instead it shows "." I was expecting to show me this: Is there a way to get to only display directories instead of files and dire…

Error Output

-d, --directory
          list directory entries instead of contents, and do not  derefer‐
          ence symbolic links

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: The command 'ls -d' is not displaying directories. Is there a way to get 'ls' to only display directories instead of files and directories?

Low Risk

Your expectations are based upon DOS Think/Windows Think and are wrong. On MS-DOS, Windows, and indeed a few other IBM/Microsoft operating systems, wildcard expansion is done by the command itself, and things like the option to the command act as at…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment