LS command in Unix

Prev     Next

ls command in UNIX:

ls command in UNIX is used to lists the files and directories from the Unix directory.


Options in ls command in Unix:

ls -l :

Long listing of files. List in long format, giving mode, number of links, owner, group, size in bytes and time of last modification for each file.


ls -r:

To reverse the order of sort to get reverse (descending) collation or oldest first, as appropriate.


ls -t:

To sort by time modified (latest first) before sorting alphabetically.


In the real world, most of the time we will be using the command “ls -lrt” to list the files in the orders.


UNIX command

  • By looking at the above examples, you can easily identify the difference between the each commands.
  • There are many number of options available in Unix for ls command. You can get to know each option using man command.

Like it? Please Spread the word!