$ whatis link

link link (1) - call the link function to create a link to a file

Examples:

# link --version

link (GNU coreutils) 8.5 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Michael Stone. In order to make a physical link to a binary or file, I need to know the location of the binary/file. In this case, I am using nslookup as an example, so I type the command which to find the location of the nslookup binary.

# which nslookup

/usr/sbin/nslookup Now, I make a physical link to the nslookup and call the new file link-2-nslookup.

# link /usr/sbin/nslookup link-2-nslookup

I check the type of the file I just created, since it is a physical link to the file the type of file is the same as the nslookup and as shown below both files have the same i-node numbers 55980.

# file link-2-nslookup

link-2-nslookup: LF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, stripped

# ls -li /usr/sbin/nslookup link-2-nslookup

55980 -r-xr-xr-x 2 root bin 81884 2010-11-05 08:02 /usr/sbin/nslookup 55980 -r-xr-xr-x 2 root bin 81884 2010-11-05 08:02 link-2-nslookup As shown below, I am using a few examples of both nslookup and the new link-2-nslookup file I created using the link commmand. As you can see the output of both commands are the same.

# /usr/sbin/nslookup www.mywebuniversity.com

Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: www.mywebuniversity.com Address: 69.65.10.238

# ./link-2-nslookup www.mywebuniversity.com

Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: www.mywebuniversity.com Address: 69.65.10.238

# nslookup ourunix.com

Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: ourunix.com Address: 173.51.166.200

# ./link-2-nslookup ourunix.com

Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: ourunix.com Address: 173.51.166.200

Please click on " man link " to see the Manual Page for this command.


Previous Home Page Next


Contact us      |      About us      |      Term of use      |       Copyright © 2000-2023 MyWebUniversity.com ™