+ -
当前位置:首页 → 问答吧 → 怎么知道最后访问的时间,精确到秒?

怎么知道最后访问的时间,精确到秒?

时间:2003-11-20

来源:互联网

我就看到-u了。
man ls|grep access

作者: home   发布时间: 2003-11-20

unix time (file) has 3 notation:
atime: access time
mtime: last modified time
ctime: create time
兄弟们,是学基础的时候了!!!

作者: werix   发布时间: 2003-11-20

用ls -lTu 就行了。

作者: home   发布时间: 2003-11-20

Here is a simple perl script by lawries
#!/usr/bin/perl -w ##############################################################################
# #
# FILE NAME: ftime #
# #
#----------------------------------------------------------------------------#
# PURPOSE: Retrive full set of file date #
# #
#----------------------------------------------------------------------------#
# usage: #
# List of files piped into ftime #
# #
# example: #
# #
# ls -l | awk '{ print $9 }' | /usr/local/bin/ftime #
# #
#----------------------------------------------------------------------------#
# REVISIONS: #
# #
# Lawrie November 2003 #
##############################################################################

use strict;
# use File::stat;

while (<>) {

chomp($_);
my($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime,
$ctime, $blksize, $blocks) = stat($_);

my $access = localtime $atime;
my $modify = localtime $mtime;
my $inodes = localtime $ctime;

printf "$_ : \n";
printf " Last Access Time : $access \n";
printf " Last Modify Time : $modify \n";
printf " Last Inode change: $inodes \n";

}

作者: werix   发布时间: 2003-11-22

谢谢版主~~~~~~~~~~~~~~~~

FREE# perl full_time_free foo
Use of uninitialized value at full_time_free line 32, <> chunk 1.
Use of uninitialized value at full_time_free line 33, <> chunk 1.
Use of uninitialized value at full_time_free line 34, <> chunk 1.
#!/usr/bin/perl -w :
Last Access Time : Thu Jan 1 00:00:00 1970
Last Modify Time : Thu Jan 1 00:00:00 1970
Last Inode change: Thu Jan 1 00:00:00 1970
FREE#

上面的三行好象是出错信息哦。。。

作者: home   发布时间: 2003-11-22

为了提高性能,atime很有可能不刷新

作者: x11   发布时间: 2003-11-27

热门下载

更多