When ?..? isn?t the same? (not a problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I don?t understand why ".." isn?t working the same way for "ls" and "cd" when inside
a symbolic link. The reason I ask is that I made a link to a directory with some
scripts that saves output in "../output.txt" and I could not find the output until I
found that ".." isn?t the directory you see when you do a $pwd. I solved the problem
by making a directory and then make a link to each script in there.

I would just like to know:
1) if there is a good reason to this behaviour.
2) if there is a rule, so you know when ".." is level up from $ pwd and when it is
one level up from the link target.
3) if there is an alternativ way to point to the parent directory.

Personally I can't see why you would ever need ".." to be one level up from the link
target.

Example:
$ ln -s /home link_to_home; cd link_to_home

$ ls ..
bin   dev  home    lib   misc  


$ cd ..;ls
link_to_home


Have a nice weekend
Ulrik







-- 
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux