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.
目前我有这个代码:
rm -f /etc/file.conf ln -s /etc/configuration/file.conf /etc/file.conf
我想知道是否有一种方法可以一步完成,而不必先删除原始文件。我试图查找符号链接的各种标志,但运气不佳。
您可以使用选项告诉ln删除目标文件-f
ln
-f
ln -fs /etc/configuration/file.conf /etc/file.conf