In Linux, the file or directory has three time property
- atime
- ctime
- mtime
Jane name | full name | Chinese | effect |
atime | Access Time | interview time | Last accessed files ( read or execution ) time |
ctime | Change Time | Time change | Last changed file ( property or privileges ) or catalog ( property or privileges ) time |
mtime | Modify Time | Change the time | Last modified file ( content ) or directory ( the contents of ) time |
How to view atime, ctime, mtime
stat filename
What command would modify atime, ctime, mtime
command | atime | mtime | ctime |
mv | N | N | Y |
cp | Y | N | N |
chmod | N | N | Y |
chown | N | N | Y |
touch | Y | Y | Y |
>、>> | Y | Y | Y |
vim, vi (without modification) | Y | N | N |
vim, vi (modified) | Y | Y | Y |
./test.sh | Y | N | N |
Why modify the content, three times will change it?
Because after editing the file, not only access to the file (change the atime), also add or delete the content, size, and so the state of the file has changed, so the mtime, ctime changes are normal
mv
cp
.Sh file execution
note! Looks like only the first execution time will update atime Oh!