Symlinks funktioniert nicht, wenn der link ist in einem anderen Verzeichnis?

Wow, ich habe noch nie wirklich benutzt symlinks, dass viel vor, aber das ist wirklich verblüffend:

bash-3.2$ echo "weird" > original.txt
bash-3.2$ mkdir originals
bash-3.2$ mv original.txt originals/
bash-3.2$ cat originals/original.txt 
weird
bash-3.2$ mkdir copies
bash-3.2$ ln -s originals/original.txt copies/copy.txt
bash-3.2$ cat copies/copy.txt 
cat: copies/copy.txt: No such file or directory
bash-3.2$ ls copies/copy.txt 
copies/copy.txt
bash-3.2$ ls -l copies/copy.txt 
lrwxr-xr-x  1 zach  staff  22 Dec 22 01:23 copies/copy.txt -> originals/original.txt
bash-3.2$ cat originals/original.txt 
weird
bash-3.2$ cat copies/copy.txt 
cat: copies/copy.txt: No such file or directory
bash-3.2$ cd copies/
bash-3.2$ cat copy.txt 
cat: copy.txt: No such file or directory

Warum kann ich keine Katze der symlink in das Verzeichnis kopiert?

Wenn ich den symlink aus dem inneren der Kopien/, ich kann Katze es nur gut. Wenn ich den symlink im aktuellen Verzeichnis, kann ich auch die Katze es nur gut. Wenn ich den symlink im aktuellen Verzeichnis und verschieben Sie es dann in Kopien/, bekomme ich "copies/copy.txt: Keine solche Datei oder das Verzeichnis".

InformationsquelleAutor user225643 | 2011-12-22
Schreibe einen Kommentar