Question #6846   Submitted by Answiki on 10/10/2022 at 06:23:24 PM UTC

In linux command line, how to know the owner of a file?

Answer   Submitted by Answiki on 10/10/2022 at 06:22:58 PM UTC

The ls command has a -l (use a long listing format) option that allows you to display various information about the files, including the owner's name:

ls -l

total 72
-rwxrwxr-x 1 owner group  1091 mai   19 19:54  file1.txt
drwxr-xr-x 3 owner group  4096 oct.   1 20:27  file2.txt
drwxr-xr-x 3 owner group  4096 sept. 10 12:33  file3.txt

It is also possible to execute this command for a particular file:

ls -l file.txt

3 events in history
Question by Answiki 10/10/2022 at 06:23:24 PM
In linux command line, how to know the owner of a file?
Answer by Answiki on 10/10/2022 at 06:22:58 PM

The ls command has a -l (use a long listing format) option that allows you to display various information about the files, including the owner's name:

ls -l

total 72
-rwxrwxr-x 1 owner group  1091 mai   19 19:54  file1.txt
drwxr-xr-x 3 owner group  4096 oct.   1 20:27  file2.txt
drwxr-xr-x 3 owner group  4096 sept. 10 12:33  file3.txt

It is also possible to execute this command for a particular file:

ls -l file.txt

Question by Answiki 10/10/2022 at 06:20:48 PM
How to know the owner of a file under Linux?
# ID Query URL Count

Icons proudly provided by Friconix.