CentOS Linux Server Guide

Showing file status and file type in CentOS Linux

Stat and file are  two command Linux command that you can use to check and determine the file types and the file status.
 

Syntax

 

stat [OPTION] filename -  Display file or file system status.

file [OPTION] filename - [OPTION] filename

 
Command and options Description

stat

the command is rather useful for checking file properties. This is also useful for security checking of when the files was modified.
# stat A.txt
File: `A.txt'
Size: 8 Blocks: 16 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 1200578 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2009-11-28 15:19:16.000000000 -0500
Modify: 2009-11-28 15:19:03.000000000 -0500
Change: 2009-11-28 15:19:03.000000000 -0500

 

file

the command give you are brief idea of file types
# file A.txt
A.txt: ASCII text

 

 

Back to Managing Files and Folders in CentOS Linux



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy