[linux] How can I symlink a file in Linux?

Creating Symbolic links or Soft-links on Linux:

Open Bash prompt and type the below mentioned command to make a symbolic link to your file:

A) Goto the folder where you want to create a soft link and typeout the command as mentioned below:

$ ln -s (path-to-file) (symbolic-link-to-file)
$ ln -s /home/user/file new-file

B) Goto your new-file name path and type:

$ ls -lrt (To see if the new-file is linked to the file or not)

Example:

user@user-DT:[~/Desktop/soft]# ln -s /home/user/Desktop/soft/File_B /home/user/Desktop/soft/File_C
user@user-DT:[~/Desktop/soft]# ls -lrt
total 0
-rw-rw-r-- 1 user user  0 Dec 27 16:51 File_B
-rw-rw-r-- 1 user user  0 Dec 27 16:51 File_A
lrwxrwxrwx 1 user user 31 Dec 27 16:53 File_C -> /home/user/Desktop/soft/File_B


Note: Where, File_C -> /home/user/Desktop/soft/File_B  Means, File_C is symbolically linked to File_B