0

When I entered following command in my terminal

ls -la /etc | grep "\->"

I got following list & need to know what type of link is this type

https://i.sstatic.net/Q7ATo.png

and kindly guide me how can I create this type of links.

the type of link is different

and i followed following instruction

  • created a folder called folder-a
  • entered following command ln -sv folder-a folder-b
  • and output is displayed as ‘folder-b’ -> ‘folder-a’
  • when i type ls - l the color is cyan blue folder-b -> folder-a

but i am expecting above image result

2 Answers2

1

When you see the 'redirect' characters -> in the file list, it is symbolic links, made by ln -s xxx yyy. That is is soft links (also called symbolic links) is also shown by the first 'l' in the access-rights.

The other link option is hard links. The number just after the access-rights show how many hard-links there are to a file or directory. To find the other(s) you have to look for files/directories with same inode-number in the same filesystem.

Hard links can only be within the same filesystem. Soft links can cross filesystem borders.

Soren A
  • 7,191
0

The coimmand is ln. See the man page for all details but basically, it has the following form:

ln [OPTION]... [-T] TARGET LINK_NAME 

TARGET is the file you want to be linked, LINK_NAME is the new name. In your case, resolv.conf is the LINK_NAME and ../run/resolvconf/resolv.conf, the TARGET. You should also take into consideration you have physical and symbolic links.