-2
ln -sf
不會覆蓋給定的符號鏈接。如何使用'ln'替換符號鏈接
+2:34% ls -ld ema*
drwxr-xr-x 22 b users 4096 Nov 25 14:33 emacs
drwxr-xr-x 22 b users 4096 Nov 25 14:29 emacs-201611181546
-rw-r--r-- 1 b users 0 Nov 25 14:34 emacs-current
+2:34% ln -fs emacs-201611181546 emacs-current
+2:34% ls -ld ema*
drwxr-xr-x 22 b users 4096 Nov 25 14:33 emacs
drwxr-xr-x 22 b users 4096 Nov 25 14:29 emacs-201611181546
lrwxrwxrwx 1 b users 18 Nov 25 14:34 emacs-current -> emacs-201611181546
+2:34% ln -fs emacs emacs-current
+2:34% ls -ld ema*
drwxr-xr-x 22 b users 4096 Nov 25 14:33 emacs
drwxr-xr-x 22 b users 4096 Nov 25 14:34 emacs-201611181546
lrwxrwxrwx 1 b users 18 Nov 25 14:34 emacs-current -> emacs-201611181546
我本來期望
lrwxrwxrwx 1 b users 18 Nov 25 14:34 emacs-current -> emacs
至於解決方法,我可以明確地斷開鏈接。
+2:34% unlink emacs-current
+2:35% ls -ld ema*
drwxr-xr-x 22 b users 4096 Nov 25 14:33 emacs
drwxr-xr-x 22 b users 4096 Nov 25 14:34 emacs-201611181546
+2:35% ln -fs emacs emacs-current
+2:35% ls -ld ema*
drwxr-xr-x 22 b users 4096 Nov 25 14:33 emacs
drwxr-xr-x 22 b users 4096 Nov 25 14:34 emacs-201611181546
lrwxrwxrwx 1 b users 5 Nov 25 14:35 emacs-current -> emacs
但我寧願
ln
做的工作。
這可能嗎?怎麼樣?
爲什麼downvote?跟隨或不跟隨可能會引起混淆。 – ceving