如何获取Unix中文件的修改日期和年份? [英] How to get the modified date and year of file in Unix?
本文介绍了如何获取Unix中文件的修改日期和年份?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一个命令来获取Unix中文件的修改日期,包括年份.当前,当我使用 ls -lrt A.sh
我们得到以下详细信息:-rwxrwSrwx 1 infprdbi bis 34816 Jan 31 15:44 A.sh
I am looking for a command to get the modified date of file in Unix including the year.
Currently when I am using ls -lrt A.sh
we get following details:
-rwxrwSrwx 1 infprdbi bis 34816 Jan 31 15:44 A.sh
推荐答案
您可以通过-time-style
选项指定时间格式:
You can specify the time format via --time-style
option:
ls -la --time-style=full-iso
ls -la --time-style=+%Y-%m-%d
这篇关于如何获取Unix中文件的修改日期和年份?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文