View and modify file times under Linux

Source: Internet
Author: User

I. Viewing file time and related commands

1. Stat View file time

[Email protected] ~]# stat install.log  File: "Install.log"  size:33386 blocks:80         IO block:4096   General file device:fd00h/64768d    inode:7692962     links:1access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root) access:2012-07-13 16:02:34.000000000 +0800modify:2011-11-29 16:03:06.000000000 + 0800change:2011-11-29 16:03:08.000000000 +0800

Description: Access time for access. Modify modification time. Change state changes time. Can stat * View the status of all files in this directory.

And we want to see the specific time of the three time of a file, and save it in the format of days and seconds. We can use the following command:

[Email protected] ~]# Stat install.log|grep-i Modify | Awk-f. ' {print $} ' | awk ' {print $2$3} ' | awk-f-' {print $1$2$3} ' | Awk-f: ' {print $1$2$3} ' 20111129160306

View and modify file times under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.