統(tǒng)一給文件加前綴,示例如下:
bianxh:2 bianxh$ ll
total 264
drwxr-xr-x 33 bianxh staff 1122 9 16 13:43 .
drwxr-xr-x 9 bianxh staff 306 9 16 13:44 ..
-rw-r--r--@ 1 bianxh staff 397 9 16 12:26 EL表達(dá)式,結(jié)果取整.md
-rw-r--r--@ 1 bianxh staff 801 9 16 12:26 Eclipse-Java-EE-IDE修改web項目部署路徑.md
-rw-r--r--@ 1 bianxh staff 2607 9 16 12:27 小結(jié):使用正則表達(dá)式提取時間中的數(shù)字.md
bianxh:2 bianxh$ for var in *.md; do mv "$var" "2017-09-16-${var%.md}.md"; done
bianxh:2 bianxh$ ll
total 264
drwxr-xr-x 33 bianxh staff 1122 9 16 13:44 .
drwxr-xr-x 9 bianxh staff 306 9 16 13:44 ..
-rw-r--r--@ 1 bianxh staff 397 9 16 12:26 2017-09-16-EL表達(dá)式,結(jié)果取整.md
-rw-r--r--@ 1 bianxh staff 801 9 16 12:26 2017-09-16-Eclipse-Java-EE-IDE修改web項目部署路徑.md
-rw-r--r--@ 1 bianxh staff 2607 9 16 12:27 2017-09-16-小結(jié):使用正則表達(dá)式提取時間中的數(shù)字.md
還有替換啊什么的,一些高級用法,參見:
https://my.oschina.net/musings/blog/380939
比如,假如文件名稱中有多個后綴怎么辦呢?如下:
bianxh:一一小知的副本 bianxh$ ll
total 336
drwxr-xr-x 32 bianxh staff 1088 9 16 14:04 .
drwxr-xr-x 6 bianxh staff 204 9 16 13:59 ..
-rw-r--r--@ 1 bianxh staff 6148 9 16 13:21 .DS_Store
-rw-r--r--@ 1 bianxh staff 501 9 16 12:26 2015-09-16-git代碼倉庫如何遷移.md
-rw-r--r--@ 1 bianxh staff 3149 9 16 12:26 2015-12-18-讀筆記:公司高速發(fā)展是對團(tuán)隊最好的管理.md.md
-rw-r--r--@ 1 bianxh staff 3014 9 16 12:26 2015-6-2-2-如何“有效地一對一會談”.md.md
-rw-r--r--@ 1 bianxh staff 7447 9 16 12:26 2016-09-16-OSChina git 代碼fork及PR指南.md.md
-rw-r--r--@ 1 bianxh staff 163 9 16 13:24 2016-09-16-空谷幽蘭-第六章-登天之道-第二節(jié).md.md
-rw-r--r--@ 1 bianxh staff 2159 9 16 12:26 2016-1-10-吐槽招商銀行營業(yè)廳,贊一下微信客服.md
-rw-r--r--@ 1 bianxh staff 3898 9 16 12:26 2016-1-16-Hunt.md
-rw-r--r--@ 1 bianxh staff 1854 9 16 12:26 2016-1-17:喜歡?電子書:紙質(zhì)書.md
-rw-r--r--@ 1 bianxh staff 3708 9 16 12:26 2016-1-25:新時代的企業(yè)架構(gòu)師.md
-rw-r--r--@ 1 bianxh staff 1298 9 16 12:26 2016-1-26:實踐應(yīng)當(dāng)從業(yè)務(wù)需求出發(fā).md
-rw-r--r--@ 1 bianxh staff 1676 9 16 12:26 2016-1-28:圖像壓縮技術(shù)?Lena.md
-rw-r--r--@ 1 bianxh staff 661 9 16 12:26 2016-1-28:項目經(jīng)理?產(chǎn)品經(jīng)理.md
-rw-r--r--@ 1 bianxh staff 3076 9 16 12:26 2016-10-11-內(nèi)置對象.md.md
-rw-r--r--@ 1 bianxh staff 572 9 16 12:26 2016-12-1-空谷幽蘭-第六章-登天之道-第三節(jié).md.md
-rw-r--r--@ 1 bianxh staff 2464 9 16 12:26 2016-12-5-堅持很難.md.md
-rw-r--r--@ 1 bianxh staff 1298 9 16 12:26 2016-2-5-對OKRs粗淺的理解.md.md
-rw-r--r--@ 1 bianxh staff 1129 9 16 12:26 2016-4-25:軟件模塊的3項職責(zé).md
-rw-r--r--@ 1 bianxh staff 2126 9 16 12:26 2016-4-27:我眼中“項目經(jīng)理”需要知道的.md.md
-rw-r--r--@ 1 bianxh staff 8678 9 16 12:26 2016-5-10-“深淘灘,低作堰”-華為公司的戰(zhàn)略創(chuàng)新和機(jī)制創(chuàng)新.md
-rw-r--r--@ 1 bianxh staff 760 9 16 12:26 2016-5-3-曲江海洋館簡游.md.md
-rw-r--r--@ 1 bianxh staff 10040 9 16 12:26 2016-5-4-樊登速讀-重新定義公司.md.md
-rw-r--r--@ 1 bianxh staff 802 9 16 12:26 2016-6-14-端午節(jié)日小記.md.md
-rw-r--r--@ 1 bianxh staff 422 9 16 12:26 2016-6-15:刺猬心態(tài).md
-rw-r--r--@ 1 bianxh staff 829 9 16 12:26 2016-6-16:球隊思維.md
-rw-r--r--@ 1 bianxh staff 1011 9 16 12:26 2016-6-19:沒有什么不同.md
-rw-r--r--@ 1 bianxh staff 6380 9 16 12:26 2016-7-6-OKR管理方法.md
-rw-r--r--@ 1 bianxh staff 7415 9 16 12:26 2016-9-9-[焦英俊]-阿里巴巴店鋪的十年技術(shù)演變之路.md.md
-rw-r--r--@ 1 bianxh staff 8300 9 16 12:26 2017-2-1-每個程序員都應(yīng)讀的10本經(jīng)典書籍.md.md
-rw-r--r--@ 1 bianxh staff 8833 9 16 13:25 2017-4-1-JSP.md.md
bianxh:一一小知的副本 bianxh$ rename 's/\.md.md$/\.md/' *.md
bianxh:一一小知的副本 bianxh$ ll
total 336
drwxr-xr-x 32 bianxh staff 1088 9 16 14:05 .
drwxr-xr-x 6 bianxh staff 204 9 16 13:59 ..
-rw-r--r--@ 1 bianxh staff 6148 9 16 13:21 .DS_Store
-rw-r--r--@ 1 bianxh staff 501 9 16 12:26 2015-09-16-git代碼倉庫如何遷移.md
-rw-r--r--@ 1 bianxh staff 3149 9 16 12:26 2015-12-18-讀筆記:公司高速發(fā)展是對團(tuán)隊最好的管理.md
-rw-r--r--@ 1 bianxh staff 3014 9 16 12:26 2015-6-2-2-如何“有效地一對一會談”.md
-rw-r--r--@ 1 bianxh staff 7447 9 16 12:26 2016-09-16-OSChina git 代碼fork及PR指南.md
-rw-r--r--@ 1 bianxh staff 163 9 16 13:24 2016-09-16-空谷幽蘭-第六章-登天之道-第二節(jié).md
-rw-r--r--@ 1 bianxh staff 2159 9 16 12:26 2016-1-10-吐槽招商銀行營業(yè)廳,贊一下微信客服.md
-rw-r--r--@ 1 bianxh staff 3898 9 16 12:26 2016-1-16-Hunt.md
-rw-r--r--@ 1 bianxh staff 1854 9 16 12:26 2016-1-17:喜歡?電子書:紙質(zhì)書.md
-rw-r--r--@ 1 bianxh staff 3708 9 16 12:26 2016-1-25:新時代的企業(yè)架構(gòu)師.md
-rw-r--r--@ 1 bianxh staff 1298 9 16 12:26 2016-1-26:實踐應(yīng)當(dāng)從業(yè)務(wù)需求出發(fā).md
-rw-r--r--@ 1 bianxh staff 1676 9 16 12:26 2016-1-28:圖像壓縮技術(shù)?Lena.md
-rw-r--r--@ 1 bianxh staff 661 9 16 12:26 2016-1-28:項目經(jīng)理?產(chǎn)品經(jīng)理.md
-rw-r--r--@ 1 bianxh staff 3076 9 16 12:26 2016-10-11-內(nèi)置對象.md
-rw-r--r--@ 1 bianxh staff 572 9 16 12:26 2016-12-1-空谷幽蘭-第六章-登天之道-第三節(jié).md
-rw-r--r--@ 1 bianxh staff 2464 9 16 12:26 2016-12-5-堅持很難.md
-rw-r--r--@ 1 bianxh staff 1298 9 16 12:26 2016-2-5-對OKRs粗淺的理解.md
-rw-r--r--@ 1 bianxh staff 1129 9 16 12:26 2016-4-25:軟件模塊的3項職責(zé).md
-rw-r--r--@ 1 bianxh staff 2126 9 16 12:26 2016-4-27:我眼中“項目經(jīng)理”需要知道的.md
-rw-r--r--@ 1 bianxh staff 8678 9 16 12:26 2016-5-10-“深淘灘,低作堰”-華為公司的戰(zhàn)略創(chuàng)新和機(jī)制創(chuàng)新.md
-rw-r--r--@ 1 bianxh staff 760 9 16 12:26 2016-5-3-曲江海洋館簡游.md
-rw-r--r--@ 1 bianxh staff 10040 9 16 12:26 2016-5-4-樊登速讀-重新定義公司.md
-rw-r--r--@ 1 bianxh staff 802 9 16 12:26 2016-6-14-端午節(jié)日小記.md
-rw-r--r--@ 1 bianxh staff 422 9 16 12:26 2016-6-15:刺猬心態(tài).md
-rw-r--r--@ 1 bianxh staff 829 9 16 12:26 2016-6-16:球隊思維.md
-rw-r--r--@ 1 bianxh staff 1011 9 16 12:26 2016-6-19:沒有什么不同.md
-rw-r--r--@ 1 bianxh staff 6380 9 16 12:26 2016-7-6-OKR管理方法.md
-rw-r--r--@ 1 bianxh staff 7415 9 16 12:26 2016-9-9-[焦英俊]-阿里巴巴店鋪的十年技術(shù)演變之路.md
-rw-r--r--@ 1 bianxh staff 8300 9 16 12:26 2017-2-1-每個程序員都應(yīng)讀的10本經(jīng)典書籍.md
-rw-r--r--@ 1 bianxh staff 8833 9 16 13:25 2017-4-1-JSP.md