ls

Updated: 16 November 2023

Show only directories matching glob, but not their contents

ls -d /a/path/foo*

Show first 7 rows only

ls | head -7

Order by date

ls -t

Order by date, most recent at bottom

ls -tr

List all files in a directory and sub-directories

ls -R

List directories first (tab completion possible)

ls -l --group-directories-first

List filename only, in one column

ls -1

Turn on colour

ls --color=always -la

Leave a comment