Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

What command is used to create a symbolic link/soft link?

share|improve this question
    
@IconDaemon Could you please put the "a" before "symbolic", since I don't have enough reputation to made such minor changes. –  idmean Mar 26 at 20:38
1  
Can you please mark this as answered? –  Benjamin R Mar 29 at 23:49

2 Answers 2

┌── ln(1) link, ln -- make links
│   ┌── Create a symbolic link.
│   │                         ┌── the path to the intended symlink
│   │                         │   can use . or ~ or other relative paths
│   │                   ┌─────┴────────┐
ln -s /path/to/original /path/to/symlink
      └───────┬───────┘
              └── the path to the original file/folder
                  can use . or ~ or other relative paths

i.e.

echo "baz" > foo
ln -s foo bar  
ls -al    bar  # bar -> foo
cat       bar  # displays contents of foo: baz

For more information about ln(1) see the man page.

share|improve this answer
3  
to make it (even more) clear. /path/to/original is the file or folder pointed to by the symlink in /path/to/symlink –  Juan Feb 11 at 16:42

The command is called ln. If used with the option -s it will create a symbolic link in the current directory:

ln -s /any/file/on/the/disk linked-file
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.