MacOS – Seeing current permissions for a file

macospermission

How can I see the permissions for a file (e.g. if I want to recreate those permissions for another file using chmod)?

For example after I run chmod 644 on foo.txt, what command, if any, can I run on foo.txt which returns 644?

Best Answer

If you type ls -l in terminal you get the permission for your file

drwxr-xr-x   7 ---  staff   238 Apr 14  2010 images
-rw-r--r--   1 ---  staff  2628 Aug 26  2009 index.html
drwxr-xr-x@ 11 ---  staff   374 Feb 28  2010 simplemvc

You can use table below to convert rwxr-xr-x to number and vice versa:

alt text

And get more detail here.