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 check the ownership and permissions of a file or directory without a verbose output.

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

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

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

Pro-Tip: Combine this with `ls -l` to see a more detailed view, or use `stat -c “%U:%G %a”` to get just the owner, group, and permissions without the filename.

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

0 0 votes
Article Rating
Exit mobile version