LS

From Network Security Wiki
Revision as of 17:45, 27 September 2017 by Amanjosan2008 (talk | contribs)


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

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

Details:

  / = directory
  @  = 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
  • 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)



References





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