43

This question already has an answer here:

I want to create a symlink that should point to another directory.

Like inside directory /var/www/vhosts/ecash-staging.com/ should be a symlink named as ecash_root that should pointing to --> /var/www/vhosts/ecash_cfe.

How is this possible ?

I have googled but there some people said that there should be a dir ecash_root exist in /var/www/vhosts/ecash_cfe/... but I do not want that.

i just have to create symlink in /var/..../ecash-staging.com/ name as ecash_root that should point to /var/www/vhosts/ecash_cfe but should not be a ecash_root dir inside /var/www/vhosts/ecash_cfe.

thanks to all

marked as duplicate by Arronical, muru, Eric Carvalho, WinEunuuchs2Unix, Pilot6 Nov 1 '16 at 10:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    open a terminal, enter ln --help or/and man ln and read it for additional information... – DJCrashdummy Oct 31 '16 at 6:22
75

Use ln:

ln -s /var/www/vhosts/ecash_cfe /var/www/vhosts/ecash-staging.com/ecash_root
  • -s stands for symbolic link

  • /var/www/vhosts/ecash_cfe is the source file

  • /var/www/vhosts/ecash-staging.com/ecash_root is the link name

  • 1
    2 commands worked for me . one of them that is @heemayl mentioned above . and other one in current directory just ran the command ls -s /var/www/vhosts/ecash_cfe ecash_root . same worked both . good . – Waqas Rana Oct 31 '16 at 6:31
  • 1
    @heemayl isn't it the other way around? – still_dreaming_1 Feb 21 '17 at 15:45
  • nope, target goes first, see docs, also @WaqasRana's comment mentions the wrong command "ls" – Efren Feb 4 '18 at 23:47
  • For me, this creates a file... – Yanick Rochon Dec 17 '18 at 21:31

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