Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Stat (system call)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Unix system call for querying file metadata}} {{Lowercase title}} {{Use mdy dates|date=May 2015}} [[File:Coreutils stat screenshot.png|thumb|<code>stat</code> command line]] '''{{code|stat()}}''' is a [[Unix]] [[system call]] that queries the [[file system]] for [[metadata]] about a [[computer file|file]] (including [[Unix file type|special files]] such as [[computer directory|directories]]). The metadata contains many fields including [[Unix file type|type]], [[file size|size]], ownership, [[File-system permissions|permission]]s and [[Unix time|timestamps]]. For example, the [[ls|{{code|ls}}]] command uses this system call to retrieve timestamps: * mtime: when last modified ({{code|ls -l}}) * atime: when last accessed ({{code|ls -lu}}) * ctime: when last status changed ({{code|ls -lc}}) {{code|stat()}} appeared in [[Research Unix#Versions|Version 1 Unix]]. It is among the few original Unix [[system call]]s to change, with [[Research Unix#Versions|Version 4]]'s addition of [[group permissions]] and larger [[file size]].<ref>{{cite tech report |first1=M. D. |last1=McIlroy |authorlink1=Doug McIlroy |year=1987 |url=http://www.cs.dartmouth.edu/~doug/reader.pdf |title=A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971β1986 |series=CSTR |number=139 |institution=Bell Labs}}</ref> Since at least 2004, the same-named [[shell (computing)|shell]] [[command (computing)|command]] <code>stat</code> has been available for [[Linux]] to expose features of the system call via a [[command-line interface]].<ref>[http://web.archive.org/web/20060430100656/http://mailman.linuxchix.org/pipermail/courses/2004-March/001425.html tee, file, stat, find- correction - linuxchix.org - Wed Mar 10 11:04:07 EST 2004 (archived on April 30, 2006)]</ref><!--Source doesn't state whether it was pre-installed, therefore worded as "available for"; not "available in".-->
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)