Skip to content

File and Directory Information with stat Command

Discover how to utilize the stat command to retrieve comprehensive details about files and directories. Explore various options to display folder paths, user and group ownership, octal permissions, inode numbers, number of hard links, file types, total size, access, modification, and change times, I/O block size, and number of allocated blocks.


stat -c '%n %U %G %n %a' $HOME
stat -c %a %n $HOME

Simulate Dolphin explorers default setup

stat -c '%n %s %U %G %a %z' $HOME/* \
	|awk '//{printf "%10s %100s %10s %10s %10s %10s\n",$1,$2,$3,$4,$5,$6 }' \
	|column -t -N Path,Size,User,Group,Perm,Modified \
	|sed "1,2 i $(printf %85s\
	|tr ' ' '=')"
stat -c %i $HOME
stat -c %h $HOME
stat -c %F $HOME
stat -c %s $HOME
stat -c %x $HOME
stat -c %y $HOME
stat -c %z $HOME
stat -c %o $HOME
stat -c %b $HOME