Difference between revisions of "Stat (command)"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<code>stat</code><ref>http://man7.org/linux/man-pages/man1/stat.1.html</ref> command display [[file]] or [[file system]] status
+
{{lc}}
 +
<code>[[wikipedia:stat]]</code><ref>http://man7.org/linux/man-pages/man1/stat.1.html</ref> command display [[file]] or [[file system]] information.
  
 
http://man7.org/linux/man-pages/man1/stat.1.html
 
http://man7.org/linux/man-pages/man1/stat.1.html
Line 5: Line 6:
 
<code>stat -c %h -- YOUR_FILE</code>
 
<code>stat -c %h -- YOUR_FILE</code>
  
  stat -c "%a %U:%G %n" /usr/bin/passwd
+
 
 +
  [[stat /proc/1/cmdline]]
 +
 
 +
== Examples ==
 +
[[stat -c]] "%a %U:%G %n" /usr/bin/passwd
 
  4701 root:root /usr/bin/passwd
 
  4701 root:root /usr/bin/passwd
  
Line 20: Line 25:
  
  
== Examples ==
 
 
<pre>
 
<pre>
 
stat access.log
 
stat access.log
Line 36: Line 40:
 
* <code>[[stat (Ansible module)]]</code>
 
* <code>[[stat (Ansible module)]]</code>
 
* <code>[[mc stat]]</code>
 
* <code>[[mc stat]]</code>
* <code>lstat</code> function
+
* <code>stat</code> and <code>[[lstat]]</code> function
 +
* <code>[[inode]]</code>
 +
* [[Octal]]
  
 
== See also ==
 
== See also ==
 +
* {{UID}}
 
* {{files}}
 
* {{files}}
 
* {{ext4}}
 
* {{ext4}}
  
 
[[Category:Linux commands]]
 
[[Category:Linux commands]]

Latest revision as of 11:46, 14 July 2023

wikipedia:stat[1] command display file or file system information.

http://man7.org/linux/man-pages/man1/stat.1.html

stat -c %h -- YOUR_FILE


stat /proc/1/cmdline

Examples[edit]

stat -c "%a %U:%G %n" /usr/bin/passwd
4701 root:root /usr/bin/passwd


stat /etc/passwd
  File: /etc/passwd
  Size: 1760      	Blocks: 8          IO Block: 4096   regular file
Device: fc01h/64513d	Inode: 71420       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-08-25 09:23:36.756687787 +0400
Modify: 2020-08-21 16:22:54.493394970 +0400
Change: 2020-08-21 16:22:54.493394970 +0400
 Birth: -


stat access.log
  File: access.log
  Size: 0         	Blocks: 0          IO Block: 4096   regular empty file
Device: fc11h/64529d	Inode: 8528827     Links: 1
Access: (0644/-rw-r--r--)  Uid: (  104/    _apt)   Gid: (  107/messagebus)
Access: 2019-12-31 16:28:22.654021588 +0400
Modify: 2019-12-31 16:27:48.294004369 +0400
Change: 2019-12-31 16:27:50.946005778 +0400
 Birth: -

Related terms[edit]

See also[edit]

  • http://man7.org/linux/man-pages/man1/stat.1.html
  • Advertising: