Softlink problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Softlink problem
# 1  
Old 04-22-2014
Softlink problem

Hi

there is a file 'linkk' and i have created a softlink for it in another directory.
Code:
 
$ pwd
/home/guest/khare
 
$ ln -s linkk /home/guest/khare/AWK/done

now under AWk dir i can see that the softlink is created.
Code:
 
$ pwd
/home/guest/khare/AWK
$ ls -lrt *done
lrwxr-xr-x  1 khare  guest  5 Apr 22 14:25 done -> linkk
$

now my ques here is , suppose if someone login to system and see this softlink and if he want to know the actual path of the softlink then how would he figure it out ?

my second question is
is there any way in which we can mentioned or pass the original path of the file while creating the softlink ?

Regards,
Scriptor
# 2  
Old 04-22-2014
1. $pwd/linkk
2. ln -s /home/guest/khare/AWK/linkk /home/guest/khare/AWK/done
This User Gave Thanks to Scrutinizer For This Post:
# 3  
Old 04-22-2014
Quote:
Originally Posted by scriptor
now my ques here is , suppose if someone login to system and see this softlink and if he want to know the actual path of the softlink tch file then how would he figure it out ?
The same way the OS figures to which the OS figures out which file the link points to: it is stated in the command you use when creating the link. Suppose you create the link:

Code:
ln -s ./a ../b

You create a link named "a" in the current directory linking to a file named "b" located in the directory above. Exactly this - "../b" - will show up in the directory listing.

Notice, though, that a link destination does not have to exist when the link is created. In the above example, if "../b" does not exist the link will still be created and if later on "../b" is indeed created "./a" would still point to it.

Quote:
Originally Posted by scriptor
my second question is
is there any way in which we can mentioned or pass the original path of the file while creating the softlink ?
See above: yes, actually you have to.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

2. Shell Programming and Scripting

Softlink directory name not working on SUN

I am facing a peculiar problem on SUN machine. There is a soft link pointing to a directory. And there is a shell script inside this soft link which is trying to get the directory name from where this script is being executed. NAME="$(cd $(dirname $0); pwd)" I want to fetch the... (1 Reply)
Discussion started by: Tirthankar
1 Replies

3. UNIX for Dummies Questions & Answers

Softlink Issue

Hi, We have a directory /oracle/UD1/sapdata1,since sapdata1 had no space we created a directory under /oracle/UD1/orarch/sapdata1 and soft linked /oracle/UD1/sapdata1 to /oracle/UD1/orarch/sapdata1 . Is there any way I can see if the files are being actually written to... (4 Replies)
Discussion started by: buddy1
4 Replies

4. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

5. UNIX for Dummies Questions & Answers

How to identify a link whether it is a Hardlink or Softlink

i am new to UNIX environment please tell me how to identify a link whether it is a Hardlink or Softlink ? what is the command? thank you all .......:o:o (2 Replies)
Discussion started by: sasith90
2 Replies

6. Red Hat

Mail Problem. Maybe, it is a DNS Problem!

Hi, i've a redhat linux 9 upadated by redhat from 7 version to 9 version. A couple of days ago i was a problem with my mail, in other words i'm not able to get any email nor to send any email. I've a proxy configuration and i tried to set iptables in order to verify the port. The 110,255 and 995... (1 Reply)
Discussion started by: pintalgi
1 Replies

7. Solaris

solaris 10- cant create softlink

bash-3.00# ln -s /lib /usr/lib ln: cannot create /usr/lib/lib: File exists bash-3.00# (4 Replies)
Discussion started by: incredible
4 Replies

8. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

9. Solaris

problem in finding a hardware problem

Hi I am right now facing a strange hardware problem. System get booted with the following error: Fatal Error Reset CPU 0000.0000.0000.0003 AFSR 0100.0000.0000.0000 SCE AFAR 0000.07c6.0000.1000 SC Alert: Host System has Reset It happen 4 or 5 times and get the same error every time.I... (8 Replies)
Discussion started by: girish.batra
8 Replies

10. UNIX for Dummies Questions & Answers

Questions on PATH env havinf softlink

I have a question regarding the PATH environment on SunOS. I am setting the PATH as - export PATH=$PATH:/bin and /bin has a softlink as lrwxrwxrwx 1 root root 9 Oct 1 2004 /bin -> ./usr/bin So, will this path will work for the bin having the softlink? Thanks for... (1 Reply)
Discussion started by: xgr3
1 Replies
Login or Register to Ask a Question