Wednesday, January 5, 2011

ln -s d1 d2 # Am I the only person who gets this the wrong way round every fucking time?

SkyHi @ Wednesday, January 05, 2011
I used to get it wrong, too. Now I remember it together with cp:

cp existing new
ln -s existing new


p source destination
mv source destination
ln [-s] source destination


user1@Januty:~/testdir$ ls -l 32.d
-rw-r--r-- 1 user1 user1 164 2011-01-04 17:07 32.d

user1@Januty:~/testdir$ ln -s 32.d 3322.dd

user1@Januty:~/testdir$ ls -tlrh 3322.dd
lrwxrwxrwx 1 user1 user1 4 2011-01-05 14:14 3322.dd -> 32.d

user1@Januty:~/testdir$ ls -tlrh 32.d
-rw-r--r-- 1 user1 user1 164 2011-01-04 17:07 32.d

user1@Januty:~/testdir$ rm 3322.dd
rm: remove symbolic link `3322.dd'? y

user1@Januty:~/testdir$ ls -tlrh 3322.dd
ls: cannot access 3322.dd: No such file or directory

user1@Januty:~/testdir$ ls -tlrh 32.d
-rw-r--r-- 1 user1 user1 164 2011-01-04 17:07 32.d

REFERENCES
http://www.reddit.com/r/programming/comments/1qt0/ln_s_d1_d2_am_i_the_only_person_who_gets_this_the