Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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

ln -s /storage/thumbs thumbs

You're also using the wrong command.

share|improve this answer
    
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 8 '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. –  Iain Jan 8 '11 at 16:26
    
figured it out, thanks! –  Andrew Fashion Jan 8 '11 at 16:27

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.