Thursday, November 5, 2015

How to build simlink on linux

Create symlink example.

1.  Log in on the system.



2.  Now issue ln -s command to instruct Linux to create symlink to a file, the example below we make a link (shortcut) that call dns that link to /etc/resolf.conf the configuration file that contain DNS server name for our Linux system. 
Linux create symlink
[linux@fedora11 ~]$ ln -s /etc/resolv.conf dns
[linux@fedora11 ~]$
3.  To verify that the our symlink or symbolic link created successfully, issue ll command or ls -l --color=auto
symlink or symbolic link
[linux@fedora11 ~]$ ll
total 32
drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Desktop
lrwxrwxrwx. 1 linux linux   16 2010-04-25 17:37 dns -> /etc/resolv.conf
drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Documents
drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Download
drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Music
drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Pictures
drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Public
drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Templates
drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Videos
[linux@fedora11 ~]$
4.  issue cat command to test our new symlink / symbolic link working perfectly.  Note that dns is symlink to /etc/resolf.conf configuration file.
test our new symlink symbolic link working perfectly
[linux@fedora11 ~]$ cat dns
# Generated by NetworkManager
domain localdomain
search localdomain
nameserver 192.168.228.2
[linux@fedora11 ~]$
Read more on Linux symbolic link, Windows shortcut and Windows symbolic link, to know the different between them.
Keywords: linux create symlink, linux create symbolic link, create syslink, create symbolic link, create linux symlink, create linux symbolic link, create symlink linux, create symbolic link linux  

No comments:

Post a Comment