Some ls commands

By Gavin Phillips @ Cowshed Works Ltd

Blog Picture

Yep, I can also never remember the useful ls command combos so I'm adding them all here so I can check in and grab them.

List files by modified date in reverse order (last edited on last line, the most useful way to do it!)

ls -ltr

List all directories in current directory

ls -d */

List everything on a new line

ls -1

Show hidden files

ls -a

Show files recursively - not massively useful unless piped to something else.

ls -R

Show list of files including inode value, useful when you want to delete those files with crappy filenames.

ls -li

Author: Gavin Phillips
Published: Apr 6, 2017 (1 year ago)

Work with Cowshed:Works

Ready to start your next website or app project? Give us a call or send us an email.

© Cowshed Works Ltd: UK Staffordshire-based website design, build and management

VAT: 251 4480 22 - Registered in England: 10399485

Terms: Website | Service