Linux常用基本命令:touch命令(2)

linuxidc@linuxidc:~/linux/mkdir$ stat linuxidc2.txt
  File: 'linuxidc2.txt'
  Size: 5            Blocks: 8          IO Block: 4096  regular file
linuxidcice: 807h/2055d    Inode: 9569550    Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/ linuxidc)  Gid: ( 1000/ linuxidc)
Access: 2018-05-01 17:29:34.982228802 +0800
Modify: 2018-05-01 17:29:34.982228802 +0800
Change: 2018-05-01 17:32:25.392863791 +0800
 Birth: -
linuxidc@linuxidc:~/linux/mkdir$ chmod 777 linuxidc2.txt
linuxidc@linuxidc:~/linux/mkdir$ stat linuxidc2.txt
  File: 'linuxidc2.txt'
  Size: 5            Blocks: 8          IO Block: 4096  regular file
linuxidcice: 807h/2055d    Inode: 9569550    Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ linuxidc)  Gid: ( 1000/ linuxidc)
Access: 2018-05-01 17:29:34.982228802 +0800
Modify: 2018-05-01 17:29:34.982228802 +0800
Change: 2018-05-01 17:33:31.602584110 +0800
 Birth: -

touch -m修改文件的modify和change时间

linuxidc@linuxidc:~/linux/mkdir$ stat linuxidc2.txt
  File: 'linuxidc2.txt'
  Size: 5            Blocks: 8          IO Block: 4096  regular file
linuxidcice: 807h/2055d    Inode: 9569550    Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ linuxidc)  Gid: ( 1000/ linuxidc)
Access: 2018-05-01 17:29:34.982228802 +0800
Modify: 2018-05-01 17:29:34.982228802 +0800
Change: 2018-05-01 17:33:31.602584110 +0800
 Birth: -
linuxidc@linuxidc:~/linux/mkdir$ touch -m linuxidc2.txt
linuxidc@linuxidc:~/linux/mkdir$ stat linuxidc2.txt
  File: 'linuxidc2.txt'
  Size: 5            Blocks: 8          IO Block: 4096  regular file
linuxidcice: 807h/2055d    Inode: 9569550    Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ linuxidc)  Gid: ( 1000/ linuxidc)
Access: 2018-05-01 17:29:34.982228802 +0800
Modify: 2018-05-01 17:34:31.678864985 +0800
Change: 2018-05-01 17:34:31.678864985 +0800

touch -d修改创建后的文件的修改时间

linuxidc@linuxidc:~/linux/mkdir$ ls -lh linuxidc2.txt
-rwxrwxrwx 1 linuxidc linuxidc 5 5月  1 17:34 linuxidc2.txt
linuxidc@linuxidc:~/linux/mkdir$ touch -d 20190218 linuxidc2.txt
linuxidc@linuxidc:~/linux/mkdir$ ls -lh linuxidc2.txt
-rwxrwxrwx 1 linuxidc linuxidc 5 2月  18  2019 linuxidc2.txt
linuxidc@linuxidc:~/linux/mkdir$ stat linuxidc2.txt
  File: 'linuxidc2.txt'
  Size: 5            Blocks: 8          IO Block: 4096  regular file
linuxidcice: 807h/2055d    Inode: 9569550    Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ linuxidc)  Gid: ( 1000/ linuxidc)
Access: 2019-02-18 00:00:00.000000000 +0800
Modify: 2019-02-18 00:00:00.000000000 +0800
Change: 2018-05-01 17:37:13.031347481 +0800
 Birth: -

Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/12569.html