- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Symbolic Link issue where cd to path works fin...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2018 05:01 PM
04-09-2018 05:01 PM
Symbolic Link issue where cd to path works fine, but ls to ame path fails.
I have created a symbolic link to a directory.
- ln -s /tmp/data/testing /usr/appl/data/testing
- If I cd /usr/appl/data
- ls -l
- testing -> /tmp/data/testing
This is correct and what I would expect. However this is my problem. There is a directory called /usr/appl/progs
- I am in /tmp/data/testing and I "cd ../../../usr/appl/progs"
- Everything works, I actually go to the /usr/appl/progs
- However, If I am in /tmp/data/testing and I "ls ../../../usr/appl/progs", it fails (directory not found)
Any ideas?
Issue is there are pointer in the testing file to progs that cannot be seen. Changing the pointers to not use relative path would be insane.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2018 03:47 PM
04-10-2018 03:47 PM
Re: Symbolic Link issue where cd to path works fine, but ls to ame path fails.
> I have created a symbolic link to a directory.
On what?
uname -a
> o However, If I am in /tmp/data/testing and I
> "ls ../../../usr/appl/progs", it fails (directory not found)
I constructed what looked to me like a replica environment, and saw
what was expected:
dyi# uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license
dyi# mkdir -p /usr/appl/data/
dyi# mkdir -p /usr/appl/progs
dyi# touch /usr/appl/progs/u_a_p_file
dyi# mkdir -p /tmp/data/testing
dyi# ln -s /tmp/data/testing /usr/appl/data/testing
dyi# cd /usr/appl/data
dyi# ls -l
total 0
lrwxr-xr-x 1 root sys 17 Apr 10 07:26 testing -> /tmp/data/testing
dyi# cd /tmp/data/testing
dyi# cd ../../../usr/appl/progs
dyi# pwd
/usr/appl/progs
dyi# ls -l
total 0
-rw-r--r-- 1 root sys 0 Apr 10 07:25 u_a_p_file
dyi# cd /tmp/data/testing
dyi# ls -l ../../../usr/appl/progs
total 0
-rw-r--r-- 1 root sys 0 Apr 10 07:25 u_a_p_file
I'd look at all the directories in these trees to see if there are
unobvious symlinks or permission problems.
> [...] Changing the pointers to not use relative path would be insane.
Perhaps, but creating a symlink with an absolute path can cause
trouble, too.
> ln -s /tmp/data/testing /usr/appl/data/testing
If I use NFS on some other host, and I do something like:
ls /net/your_host/usr/appl/data/testing
then I could end up looking at my own "/tmp/data/testing", not the one
on "your_host". Generally safer:
ln -s ../../../../tmp/data/testing /usr/appl/data/testing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2018 06:34 PM
04-15-2018 06:34 PM
Re: Symbolic Link issue where cd to path works fine, but ls to ame path fails.
> If I am in /tmp/data/testing and I "ls ../../../usr/appl/progs", it fails (directory not found)
Not sure how that can fail if you're in /tmp/data/testing/ and not /usr/appl/data/testing/.
I.e. the former would have nothing to do with the symlink you mentioned.
You might try using "ll -id" on each path in ../../../usr/appl/progs to see what each has.