ls - list
  • lists non-hidden(non-dot) files in current directory.
  • options modify what is shown.
  • arguments identify alternative directory files to list. Both options and arguments are optional. Options : ls -a
  • lists all files in current directory, including 'hidden' (dot) files.
  • filenames starting with a . (dot) are not normally displayed by ls
  • dot files often used to store configuration options for various commands. ls -l
  • long listing - shows file-type permissions, number of names, owner, time last modified, and name. ls -d target
  • directory - surpresses traversal into subdirectories. Useful when target is a directory, lists info about directory itself. ls -q
  • quiet - shows unprintable characters as ? ls -b
  • binary - shows unprintable characters as octal or symbolic ls -F
  • classification flag ls -R
  • recursive, (note Cap.) list all visible files and contents of all sub-directories. Needs -a for all.
  • Several more available : man ls Arguments :
  • For ls, arguments are file names.
  • If name a non-directory file, lists just file.
  • If name directory, lists contents.
  • wild cards allow flexibility, close matches, but may give more than desired. Wildcards will work with most commands that use a filename as a target, so be very careful. It is possible to wipe out ALL of your files with the wrong combination of options and wildcards. Don't quote filename wildcards, they loose their definition. ls "*" literally matches a file called * if it exists. *Note - filename wildcards are not the same as regular expression wildcards.