Some ls commands

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

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

Code