-
Notifications
You must be signed in to change notification settings - Fork 1
/
ln.txt
51 lines (39 loc) · 830 Bytes
/
ln.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Link in CWD
ln -s /path/to/target
./
target -> /path/to/target
# Link in directory
ln -s /path/to/target /dir
/dir/
target -> /path/to/target
ln -s target /dir # WRONG
/dir/
target -> target
# target being within /path/
ls -sr target /path/to
/path/to/
target -> ../target
# Relative to link location: -r
ln -s ~/github/vim/_vimrc vim/win
~/github/vim/
win -> ~/github/vim/_vimrc
ln -sr ~/github/vim/_vimrc vim/win
~/github/vim/
win -> _vimrc
---
ln -s vim/_vimrc vim/win # WRONG
~/github/vim/
win -> vim/_vimrc
ln -sr vim/_vimrc vim/win
~/github/vim/
win -> _vimrc
# Treat LINK_NAME as a normal file (vs link to dir): -T
backup-old/
backup/
ln -s backup current
current -> backup/
ln -s backup-old current # WRONG
backup/
backup-old -> backup-old
ln -sfT backup-old current
current -> backup-old/