stat command

A Linux command that prints a file's metadata, such as its owner, group, permission bits, size and change times.

In more detail

Security checks use stat to read a file's owner and mode without opening it. For example, stat -c %a prints just the permission bits, so a script can compare them with the expected 600 or 644.

Example

stat -c '%a %U:%G' /etc/kubernetes/admin.conf

Related terms

Taught in

References

Certification courses