The Linux ls command

Inside a folder you can list all the files that the folder contains using the ls command:

ls

If you add a folder name or path, it will print that folder's contents:

ls /bin
Screenshot-2019-02-09-at-18.50.14

ls accepts a lot of options. One of my favorite combinations is -al. Try it:

ls -al /bin
Screenshot-2019-02-09-at-18.49.52

Compared to the plain ls command, this returns much more information.

You have, from left to right:

  • the file permissions (and if your system supports ACLs, you get an ACL flag as well)

  • the number of links to that file

  • the owner of the file

  • the group of the file

  • the file size in bytes

  • the file's last modified datetime

  • the file name

This set of data is generated by the l option. The a option instead also shows the hidden files.

Hidden files are files that start with a dot (.).

Last updated

Was this helpful?