Quick File Permissions & Ownership with `stat`

Quick Tip

Quick File Permissions & Ownership with `stat`

Challenge: You need to quickly check the ownership and permissions of a file or directory without lengthy `ls -l` output.

The Solution: Use the `stat` command with specific format options.

stat -c '%U:%G %a %n' your_file_or_directory

Why it works: The `-c` flag allows you to specify a custom output format. `%U` prints the owner’s username, `%G` prints the group’s name, `%a` prints the file’s access permissions in octal, and `%n` prints the filename.

Pro-Tip: For a more human-readable permission string (like rwxr-xr-x), use `%A` instead of `%a`.

Linux Tips & Tricks | © ngelinux.com | 5/20/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments