cipherda
cipherda

Reputation: 1

Get CHMOD Value and Owner name - Unix

Their is any command to get CHMOD value and Owner name of a directory on Unix

expected output: PATH/OF/DIR 777 ADMIN

Upvotes: 0

Views: 140

Answers (1)

frippe
frippe

Reputation: 1393

stat -c "%n %a %U" -- *

Change the wildcard to a specific directory as you wish/need.

From man stat:

-c  --format=FORMAT
          use the specified FORMAT instead of the default; output a newline after each use of FORMAT

%a     access rights in octal (note '#' and '0' printf flags)
%n     file name
%U     user name of owner

Upvotes: 1

Related Questions