Operating System - Linux
1751944 Members
4799 Online
108783 Solutions
New Discussion юеВ

difference b/w change and modify terms

 
SOLVED
Go to solution
monu_1
Regular Advisor

difference b/w change and modify terms

Dear Experts,

I am little bit confuse with the term modify and change in the output of stat command.

Please clear me about same.

Thanks,
MKS
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: difference b/w change and modify terms

Shalom,

Please post the command you used and at least a sample of the output.

stat has many options, at least on Red Hat ES 5.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
monu_1
Regular Advisor

Re: difference b/w change and modify terms

Hi Shalom!

The command is

# Stat

Regards,
MKS
James R. Ferguson
Acclaimed Contributor
Solution

Re: difference b/w change and modify terms

Hi:

The 'stat' structure maintains three timestamps: an 'atime'; a 'ctime' and an 'mtime'. These timestamps are in units of of Epoch seconds.

The 'atime' represents the last access timestamp of a file or directory.

The 'mtime' represents the last time a file or directory was *modified*; that is, the last time the file was written into. The 'mtime' is coincidently equalivalent to a "creation" moment only when a file (or directory) is first instantiated. There is no creation timestamp.

The 'ctime' is the last time a *change* of permission, ownership or name occured. Changeing any of these attributes does *not* alter the 'mtime' since the contents of the file are not modified.

Regards!

...JRF...
Maaz
Valued Contributor

Re: difference b/w change and modify terms

stat

what i found is that, whenever the contents of files are change(file edit), both the "Modified", and "Change" paramete updates

But when you just change the permission/ownership... the "Change" parameter updates only.

Regards
James R. Ferguson
Acclaimed Contributor

Re: difference b/w change and modify terms

Hi (again):

> what i found is that, whenever the contents of files are change(file edit), both the "Modified", and "Change" parameter updates

That is expected since the file's inode (containing the information retrieved by stat()') would be updated. The 'ctime' represents the inode's last change time, and another field of the inode is the size of a file.

Regards!

...JRF...