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.stack.imgur.com/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

  • Symbolic links, usually. – muru Jul 18 '17 at 08:40
  • how to create this type of Symbolic links – Sathishkumar Jul 18 '17 at 08:41
  • About creating a symbolic link you have article upon this link https://askubuntu.com/questions/56339/how-to-create-a-soft-or-symbolic-link – DevAxeQuestion Jul 18 '17 at 08:49
  • Could you please post text files, dialogue messages, and program output listings as text, not as images? To achieve the latter two you can either 1) select, copy & paste the dialogue text or terminal content or 2) save the program output to a file and use that. Longer listings (the editor will tell you what's too long) should be uploaded to a pastie service and linked to in the question. Thanks. – David Foerster Jul 18 '17 at 09:49
  • So, if I understand correctly your question is really about the output formatting and colouring of ls, not the creation of (symbolic) links. Is that correct? Could you please include the output of ls -ld folder-a (as text and, if you need colours, as an image)? What's the output of readlink folder-a? If it's folder-b then everything is in order. – David Foerster Jul 18 '17 at 11:17
  • @DavidFoerster no actually i read link type so the data is saved in folder-b only not on folder-a but when i access folder-a the data should be loaded from folder-b and the output as follows drwxrwxr-x 2 ubuntu ubuntu 4096 Jul 18 06:26 folder-a readlink folder-a No output is displayed for this – Sathishkumar Jul 18 '17 at 14:09
  • I have no clue what you mean. Could you please [edit] your question to add this information and include an example? Especially file or program output listings (with the help of the {} button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks. – David Foerster Jul 18 '17 at 14:21

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
  • 6,799
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.