The ls command is used to list the contents of a directory. Using the flags you can change the format of the output to show the information that you need. If you use just the ls command you get a normal list of files in the directory that you are in. If you add the -lah flags, it now shows you not only the name of the files, but the permissions, the ownership, the group ownership, file size, last modified date and time. This is one of the most common commands I use on a daily basis.

Synopsis

 

ls [OPTION]… [FILE]…

Examples

ls /root

ls -lah /root

ls tempdir/

Common Flags

-l use a long listing format

-h, –human-readable with -l, print sizes in human readable format (e.g., 1K 234M 2G)

-C list entries by columns

-a, –all do not ignore entries starting with .

-i, –inode print the index number of each file

 

Check out the full man page for ls