BASH List

From Indie IT Wiki
Revision as of 13:15, 22 March 2016 by imported>Indieit (→‎List By Modification Date)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

For listing files the ls command is used.

Basic List Command

No options, the returned data will show now other information other than file and/or folder names, but not hidden items.

ls

List Files With Information

This will give more information such as size, modified date and time, owner and permissions.

ls -l # Example output below

drwxr-xr-x 84 root root 4096 Jan 01 00:01 Music

List Files With Information In Human Readable Format

ls -lh # Example output below

drwxr-xr-x 84 root root 4.0K Jan 01 00:01 Music

List Hidden Items

ls -a

Combined Output Of Visible & Hidden Items

ls -lah

List In Reverse Order

ls -r

List Sub-directories Recursively

ls -R

List By Modification Date

ls -t # Newest first

ls -tr # Reversed, oldest first

Thanks to Techmint.