What does `ls -d */` do?

QuestionsQuestions8 SkillsProYour First Linux LabAug, 22 2025
0238

The command ls -d */ lists all directories in the current directory. Here's a breakdown of the components:

  • ls: This is the command used to list files and directories.
  • -d: This option tells ls to list directory entries themselves rather than their contents.
  • */: The */ pattern matches all entries that are directories (the trailing slash indicates that they are directories).

As a result, when you run ls -d */, you will see a list of all directories in the current directory, each followed by a slash (/).

0 Comments

no data
Be the first to share your comment!