Translations:Linux introduction/8/en

From Alliance Doc
Jump to navigation Jump to search

Listing directory contents

To list all files in a directory in a terminal, use the ls (list) command:

Question.png
[name@server ~]$ ls

To include hidden files:

Question.png
[name@server ~]$ ls -a

To sort results by date (from newest to oldest) instead of alphabetically:

Question.png
[name@server ~]$ ls -t

And, to obtain detailed information on all files (permissions, owner, group, size and last modification date):

Question.png
[name@server ~]$ ls -l

The option -h gives the file sizes in human readable format.