How to use “ls” command in Linux terminal

“ls” means list contents of a directory. We have various options with ls that can be used together to view files in a convenient way according to our requirement.

ls -a

ls with -a option shows all hidden files.

ls -l

ls with -l prints long listing format about each file. It consists of information like permissions(read/write/execute), owner, file size, file type(directory or file or symbolic link), last modified time and the name of the file.

ls -l can be used with another options like -t or/and -r. “-t” will sort files by modified time and “-r” reverses the order they are being sorted.

To view examples for above commands see the video below.