linux 修改文件时间
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                linux 修改文件时间
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                ?
1、ls -l *.sh
2、touch -d "10/13/2013" *.sh 【我想把所以的.sh文件修改到三個月前(2013年10月13)的時間。】
3、ls -l *.sh
參考文章
http://blog.itpub.net/29283412/viewspace-1070106/
?
另外也可以單獨修改時間或者月份,如下
以使用 am, pm 或是 24 小時的格式,日期可以使用其他格式如 6 May 2000 。?
touch -d "6:03pm" file?
Device: 802h/2050d????? Inode: 153367????? Links: 1
Access: (0644/-rw-r--r--)? Uid: (??? 0/??? root)?? Gid: (??? 0/??? root)
Access: 2014-09-23 20:38:16.160006062 -0700
Modify: 2014-09-23 20:38:16.160006062 -0700
Change: 2014-09-23 20:38:16.160006062 -0700 3、touch -m -t 199803030504 testtime3 【更改文件的最后一次修改時間為1998-03-03】 stat testtime3 File: `testtime3'
? Size: 0?????????????? Blocks: 0????????? IO Block: 4096?? regular empty file
Device: 802h/2050d????? Inode: 153367????? Links: 1
Access: (0644/-rw-r--r--)? Uid: (??? 0/??? root)?? Gid: (??? 0/??? root)
Access: 2014-09-23 20:38:16.160006062 -0700
Modify: 1998-03-03 05:04:00.000000000 -0800 【只有這里有改變】
Change: 2014-09-23 20:39:30.670005854 -0700 4、?touch -a -t 199803030504 testtime3 stat testtime3 File: `testtime3'
? Size: 0?????????????? Blocks: 0????????? IO Block: 4096?? regular empty file
Device: 802h/2050d????? Inode: 153367????? Links: 1
Access: (0644/-rw-r--r--)? Uid: (??? 0/??? root)?? Gid: (??? 0/??? root)
Access: 1998-03-03 05:04:00.000000000 -0800 【只有這里有改變】
Modify: 1998-03-03 05:04:00.000000000 -0800
Change: 2014-09-23 20:40:01.014005560 -0700 【注:已測。如果是這樣touch -t 199903030504 testtime4。Access time 和Modify time都改變了,Change time不改變】 參考文獻:http://blog.sina.com.cn/s/blog_6c9d65a10100msfy.html
轉載于:https://www.cnblogs.com/bluewelkin/p/3990269.html
總結
以上是生活随笔為你收集整理的linux 修改文件时间的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 浏览器的渲染原理
- 下一篇: html+车牌号选择,html中车牌号省
