Linux学习笔记之文件的时间属性

在windows下,一个文件有:创建时间、修改时间、访问时间。 在Linux下,一个文件也有三种时间,分别是:访问时间、修改时间、状态改动时间。 两者有此不同,在Linux下没有创建时间的概念,也就是不能知道文件的建立时间。这点就有些不方便了。 stat命令可以查看文件的时间属性 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19     # stat test.tt File: `test.tt’ Size: 3               Blocks: 8          IO Block: 4096   regular file Device: 802h/2050d      Inode: 22642770    Links: 1 Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/   root) Access: [...]

, , , ,

Linux学习笔记之date命令

一、自定义输出 [root@cent1 ~]# date +%Y-%m-%d 2010-07-17 [root@cent1 ~]# [root@cent1 ~]# date +’%Y-%m-%d %H:%M:%S’ 2010-07-17 22:55:32 [root@cent1 ~]# [root@cent1 ~]# date +’%H:%M:%S’ 22:55:44 [root@cent1 ~]# [root@cent1 sbin]# date +%T 00:08:20 [root@cent1 sbin]# 二、date -d 的使用 [root@cent1 ~]# date Sat Jul 17 22:50:59 EDT 2010 [root@cent1 ~]# [root@cent1 ~]# date -d ’10 days’ Tue Jul 27 22:51:05 [...]

, , , , , ,