Sobes.tech
Senior

How to view the list of files in the current directory with details: permissions, owner, size?

sobes.tech AI

Answer from AI

In Linux, to view a list of files in the current directory with detailed information (permissions, owner, size, etc.), the command used is:

ls -l

Key explanations:

  • -l — long format output, shows permissions, number of links, owner, group, size, date, and filename.

Example output:

-rw-r--r-- 1 user group  1234 Jun 10 12:34 file.txt

To see hidden files (starting with a dot), add the -a key:

ls -la

For sorting or additional information, other options can be used, for example, -h for human-readable sizes:

ls -lh

This will display sizes in kilobytes, megabytes, etc.