Stat Perms

April 22, 2025 Β· Tyler Yeager

Stat Perms
alias perm="stat -c '%n %U:%G-%a'"

This is a small alias I’ve used for many years. It just formats the output of stat into a clean and understandable output.

Terminal window
> perm *
file_10 user:user-664
file_11 user:user-664
file_12 user:user-664

Compare to the output of stat. It’s much more verbose. If you need that extra information, that’s great. Use it. But if you just need to quickly know ownership and permissions (the cause of most issues), perm has been my go to for a long time.

Terminal window
> stat *
File: file_10
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 25h/37d Inode: 54810 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ z) Gid: ( 1000/ z)
Access: 2025-04-22 12:08:14.448857026 -0700
Modify: 2025-04-22 12:08:14.448857026 -0700
Change: 2025-04-22 12:08:14.448857026 -0700
Birth: -
File: file_11
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 25h/37d Inode: 54811 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ z) Gid: ( 1000/ z)
Access: 2025-04-22 12:08:14.448857026 -0700
Modify: 2025-04-22 12:08:14.448857026 -0700
Change: 2025-04-22 12:08:14.448857026 -0700
Birth: -
File: file_12
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 25h/37d Inode: 54812 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ z) Gid: ( 1000/ z)
Access: 2025-04-22 12:08:14.448857026 -0700
Modify: 2025-04-22 12:08:14.448857026 -0700
Change: 2025-04-22 12:08:14.448857026 -0700
Birth: -

Did you find this interesting?

Consider subscribing 😊

No AI-generated content or SEO garbage.

Unsubscribe anytime