0

I can change the permissions of a file by:

chmod 600 ~/.ssh/authorized_keys

How can I retrieve the permissions of a file in the same format which is 600?

Johshi
  • 463
  • 2
  • 5
  • 14

1 Answers1

3

stat(1) can show many file associated attributes by specifying special format strings to it's -c option. In your case, use stat -c '%a' ~/.ssh/authorized_keys to receive the same file mode in octal, 600.

See it's manual page for a full list of supported format modifiers.