To list directories or the contents of a directory in UNIX, type ls. But for a more advanced list of directories, you can use the following shell commands:
- ls -R – This lists directories recursively (All directories within the current directory)
- ls -l – This gives details, such as the amount of space used by the directories
The above command switches can be combined, for example you can do ls -Rl to list details of directories, recursively.
❗ Note: The case of the command switches is important in UNIX.