LS

Revision as of 06:03, 1 July 2015 by m>Amandeep (table)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


LS command is used to list the files in a directory.

Task Command
LS Color Code Blue = Dir
White = Files
Red = Backups
Visual Classification of Files With Special Characters ls -F

/ = directory
nothing = normal file
@ = link file
* = Executable file

Display One File Per Line ls -1
To view hidden files ls -a
Display File Size in Human Readable Format ls -lh
Display Directory Information ls -ld /etc
Order Files Based on Last Modified Time ls -lt
Order Files Based on Last Modified Time (In Reverse Order) ls -ltr
Display Files Recursively ls -R
Useful ls Command Aliases alias ll="ls -lh"
alias lv="ls -F"
alias ls="ls -F --color=auto"
To view a long list of all the files + directories and sub-directories recursively ls -lR
To view a list of all the files with extensions only ls *.*
'more' is a filter for paging through text one screenful at a time ls -a | more
List only directories ls -l | grep ^d
List file sorted by modification time ls -t
ls -tr (in Reverse Order)
ls -lhtr (Large, Human readable, Time sort, Reverse order)



{{#widget:DISQUS |id=networkm |uniqid=LS |url=https://aman.awiki.org/wiki/LS }}