How to know the owner of a file under Linux?
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
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
| # | ID | Query | URL | Count |
|---|---|---|---|---|
| 0 | 13060 | en | https://en.ans.wiki/6845/how-to-know-the-owner-of-a-file-under-linux | 5 |