Wednesday, May 1, 2024
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 12530  / 2 Years ago, wed, april 20, 2022, 2:23:32

Can anybody give me an example why should we use the symlink kind of the "ln" command between files? I know that when you create symlink file, that file size is very small and it redirect to the main file.



The problem is when I created the symlink from a specific file (text file) from another directory, but I can't cat, less or any kind of print and view that file. Pls help me understand more about this type.



Thanks.


More From » command-line

 Answers
4

Let say you have a file named /home/george/Images/ubuntu.jpg and you want it to be available too in the /var/tmp directory, you can run:



ln -s /home/george/Images/ubuntu.jpg /var/tmp


Then, you can equally view the file using the /var/tmp/ubuntu.jpg path.



Beware not to miss to provide a correct relative or absolute path for the first parameter passed to the link command. This path is relative to the directory where the symbolic link resides. This is a common source of mistakes, like Nitin reply demonstrates.


[#30190] Thursday, April 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mocipe

Total Points: 161
Total Questions: 106
Total Answers: 118

Location: Cambodia
Member since Thu, Oct 7, 2021
3 Years ago
;