stat

gets file information 

Command


SYNOPSIS

stat [-AacLlMmqSs] file [...]


DESCRIPTION

The stat utility displays file information similar to the stat() C function call.

See the stat miscellaneous information reference page for more detail on the availability and description of the option data.

Normally, the stat displays the name of the file, a string describing the option and the option's values, in a tab-separated list, with one option per line.

Note:

On a FAT file system, modification time has a resolution of two seconds and access time has a resolution of one day.

Options

-A 

sets all of the options below (expect -q). That is, it is equivalent to -acLlMmSs.

-a 

displays the time (in seconds since midnight on January 1, 1970) the file was last accessed.

-c 

displays the time (in seconds since midnight on January 1, 1970) the file was created.

-L 

follows symbolic links.

Note:

Symbolic links are only available on 8.1/2012R2/2016/2019/2022 systems with the NTFS file system.

-l 

displays the number of hard links for the specified file.

-M 

displays the encoded description of file type and file access permissions for the specified file. This is the file access mode and the last four bytes are as described in the chmod reference page.

-m 

displays the time (in seconds since midnight on January 1, 1970) the file was last modified.

-q 

enables quiet mode. Only option data is displayed.

-S 

displays the string representation of the file access mode.

-s 

displays the file size in bytes.


DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

An error occurred.

2 

A usage error occurred.


PORTABILITY

Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


AVAILABILITY

PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
chmod, find, ls

Miscellaneous:
stat


PTC MKS Toolkit 10.4 Documentation Build 39.