Site icon New Generation Enterprise Linux

Quick `stat` for File Ownership & Permissions

Quick Tip

Quick `stat` for File Ownership & Permissions

Challenge: You need to quickly ascertain the owner, group, and permissions of a file without a verbose `ls -l` output.

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

stat -c "%U:%G %A %n" your_file_or_directory

Why it works: The `-c` flag allows `stat` to print information in a custom format. `%U` displays the owner’s username, `%G` the group name, `%A` the access rights in human-readable form, and `%n` the filename.

Pro-Tip: For just the numeric UID and GID, use `stat -c “%u:%g %A %n” your_file_or_directory`.

Published via Linux Automation Agent | 4/23/2026

0 0 votes
Article Rating
Exit mobile version