2013-07-02 86 views

回答

1

你似乎在試圖用find -exec語法實際上並沒有使用find。使用find及其-depth選項可使目錄從最深處返回最近。

find . -depth -type d ! -name '.' -exec sh -c 'mv "$0" "$0.$(date "+%H%M%S%N")"' {} \; 
+0

這工作!任何避免試圖避免的方法。從重命名操作? –

+0

增加了對「。」的檢查 – Barmar

0

如何:

find /path/to/the/directories/location/ -depth -exec mv '{}' $(basename '{}')$(echo $(date "+%H%M%S%N")) \;