如何从命令行以秒为单位显示文件的时间戳?

bar*_*lop 3 windows command-line

如何以秒显示文件的时间戳,

(创建日期/时间、修改日期/时间和访问日期/时间。所有,带秒)。

从命令行?

Hee*_*ebr 10

您可以使用 PowerShell 来获取该信息。

  1. 从开始菜单启动 PowerShell
  2. 用:

Get-ChildItem <<File or Folder>> -Force | Select-Object FullName, CreationTime, LastAccessTime, LastWriteTime, Mode, Length

它会为您打印信息。-Force用于获取用户无法访问的项目,例如隐藏文件或系统文件。此外,您可以使用该-Recurse选项递归到文件夹中。

--------- //由barlop添加

PS C:\Users\user> Get-ChildItem c:\q\az.png -Force | Select-Object FullName, CreationTime, LastAccessTime, LastWriteTime
, Mode, Length


FullName       : C:\q\az.png
CreationTime   : Sun 28 Apr 2013 12:12:59
LastAccessTime : Sun 28 Apr 2013 12:12:59
LastWriteTime  : Tue 22 Jul 2008 05:01:47
Mode           : -a---
Length         : 79248

PS C:\Users\user>
Run Code Online (Sandbox Code Playgroud)

-------------- // 结尾由 barlop 添加

递归到文件夹并拥有可以导入 Excel 的文件的一种简单方法是使用:

Get-ChildItem C:\ProjectX -Force -Recurse | Select-Object FullName, CreationTime, LastAccessTime, LastWriteTime, Mode, Length | Export-Csv c:\temp\ProjectX_files.csv

//图片由barlop添加
在此处输入图片说明