Multiple choice unix

Which of the following commands is used to display the directory attributes rather than its contents?

  1. ls -1 -d

  2. ls -1

  3. ls -x

  4. ls -F

Reveal answer Fill a bubble to check yourself
A Correct answer
AI explanation

The -d option tells ls to treat a directory argument as a plain file entry rather than listing its contents, and combining it with a long-format flag shows that entry's own attributes (permissions, owner, size, timestamps) instead of what's inside it. Plain ls -l (or similar) on a directory would instead descend into it and list its contents' attributes. ls -x and ls -F only affect display formatting/type indicators and don't restrict output to the directory's own metadata.