## stat - Display file or file system status.## -c --format=FORMAT use the specified FORMAT instead of the default;## output a newline after each use of FORMAT## The valid format sequences for files (without --file-system):## %d device number in decimal (st_dev)## %i inode number## 현재 root의 device, inode가 /sbin/init가 실행한 root와 동일한지 확인## PS1에 적용하면 normal과 chroot간에 다른 PS1 사용 가능if["$(stat-c %d:%i /)"!="$(stat-c %d:%i /proc/1/root/.)"];thenecho"We are chrooted!"elseecho"Business as usual"fi