Forrest logo
back to the ls tool

ls:tldr:7f9e5

ls: Only list directories.
$ ls -d */
try on your machine

The command "ls -d */" is used to list only directories that exist in the current working directory.

Let's break down the command:

  • "ls" is the command to list files and directories.
  • "-d" is an option that stands for "directory". It indicates that only directories should be displayed.
  • "/" is a pattern that matches all directories in the current working directory. The asterisk () is a wildcard character that represents any characters, and the forward slash (/) is a separator used to denote directories.

By executing "ls -d */", the command will show a list of all directories present in the current directory.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ls tool