Which one should be the target and which one be the link name?
Update 1: I am logged in as super user, and I also got to know to access root folder using GUI.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Almost the first line of
man ln will tell you the answer to this:
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
It's the same order as
cp: source then destination. So in your case you would use something like
cd /root/Desktop ln -s /var/log/messages messages
-s parameter instructs
ln to create a soft link rather than the default hard link.
It's possible to omit the last argument to
ln in which case the source file name will be reused
cd /root/Desktop ln -s /var/log/messages
Notice that in both cases I have changed to the destination directory. This ensures that
ln -s with relative paths will work correctly and as expected. In this situation we're using an absolute path (it begins with
/) but it's a good practice to start using.