stat
stat file
- Returns a 13-element list giving the statistics for a file, indicated by either a filehandle or an expression that gives its name. It's typically used as follows:
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat $filename;
Not all fields are supported on all filesystem types. Here are the meanings of the fields:Field Meaning devDevice number of filesystem inoInode number modeFile mode (type and permissions) nlinkNumber of (hard) links to the file uidNumeric user ID of file's owner gidNumeric group ID of file's owner rdevThe device identifier (special files only) sizeTotal size of file, in bytes atimeLast access time since the epoch mtimeLast modification time since the epoch ctimeInode change time (not creation time!) since the epoch blksizePreferred blocksize for file system I/O blocksActual number of blocks allocated $devand$ino, taken together, uniquely identify a file. The$blksizeand$blocksare likely defined only on BSD-derived filesystems. The$blocksfield (if defined) is reported in 512-byte blocks. Note that$blocks*512can differ greatly from$sizefor files containing unallocated blocks, or "holes," which aren't counted in$blocks.If
statis passed the special filehandle consisting of an underline, no actualstatis done, but the current contents of thestatstructure from the laststatorstat-based file test (the-xoperators) is returned.