1

I'm running Ubuntu 14.04 32-bit and I'm trying to understand how to see files' permisions and ownership.

7

In terminal run

ls -l

Good luck.

5

Righ-click a file Properties → Permissions.

5

Via stat

stat file_name

or via getfacl

getfacl file_name

From man getfacl

For each file, getfacl displays the file name, owner, the group, and the Access
Control List (ACL). If a directory has a default ACL, getfacl also displays the
default ACL. Non-directories cannot have default ACLs.

From man stat

Display file or file system status.
  • 2
    This should be the accepted answer in my opinion. stat does exactly what the question is asking for, other ways to see files' / directories' permissions only show those incidentally. – kos Oct 15 '15 at 17:17
2

A good way to do this is to do

ls -l

Additionally to see hidden files as well

ls -al

One thing that I have in my .bashrc is

alias ll="ls -al"
2

To get only the desired output i.e. the permissions and ownership info of a file you can use appropriate options of stat:

stat -c '%A %U:%G %n' file.txt

For example:

$ stat -c '%A %U:%G %n' file.txt
-rw-rw-r-- foobar:spamegg file.txt

With the -c or --format option of stat:

  • %A will get us the permissions

  • %U will get us the owner

  • %G will give us owner group

  • %n will give us the file name.

0

As well as those ways, in the GUI, (Nautilus, Thunar or whatever), you can change the columns setting on the 'View' menu to include the permissions, as well as many other pieces of interest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.