Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何为目录 /home/virt/ 中的所有条目设置日期(01.01.2000)和时间(00.00.00)?
非常感谢你 ;)
这很简单
for i in /home/virt/*; do touch -t 200001010000 "$i"; done
或更简单:
touch -t 200001010000 /home/virt/*
(感谢jm666)
如果你有bash4并且想要它递归:
bash4
shopt -s globstar touch -t 200001010000 /home/virt/**
或更便携:
find /home/virt -exec touch -t 200001010000 {} \;