2

I need to create a folder "2015" which re-routes to ./ but I don't know what the command is. Not sure if the term is called in this case an alias (or symbolic link).

So I need to make the same "re-route" of the 2015 folder like the 2013 and 2014 folders got the "-> ./"

... www-data    2 Jun 19  2013 2013 -> ./
... www-data    2 Jul 24  2013 2014 -> ./
... www-data 4096 Oct 17 13:30 2015

For web sub-domains purpose...

3

This is a symbolic link. Go the directory where they are pointing to and execute:

ln -s . 2015

should do it. Note the destination shall not exist. If there is currently a directory named 2015 move it before linking.

  • Hi! Before I try that, isn't ~ the root destination? Thank you – Th3Alchemist Oct 17 '14 at 11:53
  • I just noticed that it is a relative link in your question. so I edited the answer. ~ is the home directory. / is the root node. Also, . is a synonym for the current directory. – Sebastian Oct 17 '14 at 11:53
  • It worked, now it looks like this: www-data 2 Jun 19 2013 2013 -> ./ www-data 2 Jul 24 2013 2014 -> ./ marc 1 Oct 17 13:58 2015 -> . shows ".", not "./" does it make any diference? – Th3Alchemist Oct 17 '14 at 11:59
  • And for later if needed, how can I remove it? – Th3Alchemist Oct 17 '14 at 12:03
  • rm 2015 is enough. It will remove the link only (no files) – Sebastian Oct 17 '14 at 12:07
3

Go to the directory where you want to create the link and run the following command:

ln -s ./ 2015

The ln command creates links, see man ln:

       -s, --symbolic
              make symbolic links instead of hard links

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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