I created a small text file and saved it as data.txt. I then proceeded to make a symbolic link to this file :
$ ln -s data.txt data.sym
I done a "cat" on data.sym
and I got a listing of the contents of the original data.txt
file. I moved the symbolic link to a different directory, cd to that directory and when I cat the symbolic link I get
cat: data.sym: No such file or directory
I was expecting the contents of the data.txt file to be shown.
I also done this :
$ ln -s data.txt ~/temp/data.sym
I moved to the temp directory and same thing again, I done cat on data.sym
and got the "No such file or directory" error. Is this expected behaviour ? If so why ? The original file and symlink don't have to reside in the same directory do they ?