0

I type ls -l and a directory shows up like this:

lrwxrwxrwx  1 root  root  23 Jan  7 03:44 order_pictures -> /storage/order_pictures

Is that a symlink? I am trying to replicate this, so I type

ls -s thumbs/ /storage/thumbs/ 

because I need to make sure the thumbs folder points to /storage/thumbs/ but it's not working?

user9517
  • 114,104
  • 20
  • 206
  • 289
Andrew Fashion
  • 1,635
  • 7
  • 22
  • 26

3 Answers3

3

Yes, that's a symbolic link.

The reason you're unable to create one is you're using the wrong syntax: you're using ls instead of ln, and also ln wants the name of the existing file (or directory) as its first parameter, and the name of the symbolic link to create as the second one.

In your case, the right command would be ln -s /storage/thumbs thumbs.

Massimo
  • 68,714
  • 56
  • 196
  • 319
1

It is a symlink, but you have the arguments to ln backwards.

ln -s /storage/thumbs thumbs

You're also using the wrong command.

Ignacio Vazquez-Abrams
  • 45,019
  • 5
  • 78
  • 84
  • ln -s /storage/thumbs thumbs ln: creating symbolic link `thumbs/thumbs' to `/storage/thumbs': File exists------ says it already exists, but when I type ls -l, I don't see the symlink? – Andrew Fashion Jan 08 '11 at 16:22
  • @Andrew Fashion: If the thumbs directory already existed then the link will have been created in it. To do what you want you would have to remove the thumbs directory before executing the ln command. – user9517 Jan 08 '11 at 16:26
1

Yes it is. You should make a symlink with ln -s /storage/thumbs thumbs. An easy way to remember that the source goes first is that the command still works without the destination: the default is to use the name of the source.

Michael Lowman
  • 3,584
  • 19
  • 36