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.
> perm *file_10 user:user-664file_11 user:user-664file_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.
> stat * File: file_10 Size: 0 Blocks: 0 IO Block: 4096 regular empty fileDevice: 25h/37d Inode: 54810 Links: 1Access: (0664/-rw-rw-r--) Uid: ( 1000/ z) Gid: ( 1000/ z)Access: 2025-04-22 12:08:14.448857026 -0700Modify: 2025-04-22 12:08:14.448857026 -0700Change: 2025-04-22 12:08:14.448857026 -0700 Birth: - File: file_11 Size: 0 Blocks: 0 IO Block: 4096 regular empty fileDevice: 25h/37d Inode: 54811 Links: 1Access: (0664/-rw-rw-r--) Uid: ( 1000/ z) Gid: ( 1000/ z)Access: 2025-04-22 12:08:14.448857026 -0700Modify: 2025-04-22 12:08:14.448857026 -0700Change: 2025-04-22 12:08:14.448857026 -0700 Birth: - File: file_12 Size: 0 Blocks: 0 IO Block: 4096 regular empty fileDevice: 25h/37d Inode: 54812 Links: 1Access: (0664/-rw-rw-r--) Uid: ( 1000/ z) Gid: ( 1000/ z)Access: 2025-04-22 12:08:14.448857026 -0700Modify: 2025-04-22 12:08:14.448857026 -0700Change: 2025-04-22 12:08:14.448857026 -0700 Birth: -