Sebastian De Deyne
Designer & developer at Spatie

Listing directories

A listing of my favorite ls features.

To know wich directory you’re in now, use the pwd command. pwd stands for “print working directory”.

> pwd

List the current directory, use the ls command. ls is short for “list”.

> ls  assets     index.html

Include hidden files with -a.

> ls -a
.          ..         .git  assets     index.html

List everything in a single column with -1. This is useful when you want to copy/paste a directory.

> ls -1

Add a trailing slash to directories with -F. Also can be useful for copy/pasting purposes.

> ls -1F

If you enjoyed this post, you might be interested in my newsletter. I occasionally send a dispatch with personal stories, things I’ve been working on in the past month, and other interesting tidbits I come across online.