You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

NAME
ls - list directory contents

SYNOPSIS
ls [OPTION...] [FILE...]

DESCRIPTION
List information about the FILEs (the current directory by default).

OPTIONS
-a
List all files, including system and hidden.

-d
List directory entries instead of contents.

-h
Print file sizes in human-readable format.

-l
Use a long listing format.

-S
Sort by file size.

-1
(digit one) List one file per line.

EXAMPLES
Display One File Per Line Using ls -1
ls -1

Display All Information About Files/Directories Using ls -l
ls -l
     
Display hidden files using -a option:
ls -a
     
Display directory entries instead of contents, use the -d option
ls -d

 To display information of specific files
ls foo1.sql foo2.sql foo3.sql
 
To redirect the output of ls to a file in the current directory, use the command:
ls /etc >>listing.txt

SEE ALSO
cd
pwd



  • No labels