linux shell获取当前文件的时间

主要的目的是想用文件的创建时间给文件重新命令。这在从数码相机中导入录像的时候有用。

stat geoserver-1.6.5-bin.zip | grep Modify | awk ‘{print $2 $3}’ | cut -d”.” -f1 | sed -e ‘s/-//g’ -e ‘s/://g’

或者:

stat -c %y geoserver-1.6.5-bin.zip | awk ‘{print $1 $2 $3}’ | cut -d”.” -f1 | sed -e ‘s/-//g’ -e ‘s/://g’

This entry was posted in Linux and tagged , , , . Bookmark the permalink.

One Response to linux shell获取当前文件的时间

  1. Pingback: LiangXu Wang » Blog Archive » 更好的转换数码相机(canon)中的录像

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please copy the string BgVsTq to the field below:

以新浪微博帐号登录