Some ls commands

These are commands that I always forget so I'm putting them here so I can copy paste them.

Written 4 years ago on Apr 6, 2017

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

Article Category Tags

Click one to see related articles hand-written by Cowshed Works


Want to discuss your next web project?

We're happy to host meetings at the Cowshed or via conference call, we're equally happy to come and meet you to discuss your project.

Just drop us a line and we'll get it booked in and get the ball rolling.

Cowshed Works

What our clients say...