ln ln (1) - make links between files
ln (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
/usr/sbin/nslookup Now, I create a symbolic link file to nslookup and call this new created file as symlink-2-nslookup.
symlink-2-nslookup: ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, stripped
Now, I want to see the type of the files that I had created using the commands 'link' and 'ln' in previous examples.
link-2-nslookup: ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, stripped ln-P-2-nslookup: ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, stripped ln-s-2-nslookup: ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, stripped symlink-2-nslookup: ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, stripped Here, I want to get the i-node numbers of the files I had created using the commands 'link' and 'ln' in previous examples. As you can see the i-node number of the files created with the command 'link' and 'ln -P' are the same due to being physically linked, in oppose to the files that were created with 'ln -s' for symbolic or logical name which have different i-node number. As you can see from the output of the command below, the two symbolic or logical name files are kind of pointers that are pointing to the physical binary or file.
55980 -r-xr-xr-x 3 root bin 81884 2010-11-05 08:02 link-2-nslookup 55980 -r-xr-xr-x 3 root bin 81884 2010-11-05 08:02 ln-P-2-nslookup 146254 lrwxrwxrwx 1 root root 18 2011-04-23 12:40 ln-s-2-nslookup -> /usr/sbin/nslookup 146253 lrwxrwxrwx 1 root root 18 2011-04-23 12:38 symlink-2-nslookup -> /usr/sbin/nslookup Now, we are using the some examples of the actually binary and the new created files. The output of the commands are the same in either case.
Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: ourunix.com Address: 173.51.166.200
Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: ourunix.com Address: 173.51.166.200
Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: ourunix.com Address: 173.51.166.200
Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: ourunix.com Address: 173.51.166.200 Notice, the output of the of the 'ls -l and ls -L' commands below on the sybolic link file.
link-2-nslookup ln-P-2-nslookup ln-s-2-nslookup symlink-2-nslookup
ln-s-2-nslookup
Please click on " man ln. " to see the Manual Page for this command.