{"id":5353,"date":"2020-05-12T15:39:28","date_gmt":"2020-05-12T15:39:28","guid":{"rendered":"https:\/\/lamp.ciscoar.com\/?page_id=5353"},"modified":"2020-05-12T17:26:27","modified_gmt":"2020-05-12T17:26:27","slug":"winscp-how-to-create-a-symlink","status":"publish","type":"page","link":"https:\/\/lamp.ciscoar.com\/?page_id=5353","title":{"rendered":"WinSCP How to create a Symlink"},"content":{"rendered":"\n\n\n<h2 class=\"wp-block-heading\">What is a Symlink?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Symlinks (Symbolic Links) are also known as Soft links, and they are widely used on Linux, as well as in other OS, in Windows they are called &#8220;shortcuts&#8221;, basically they are just small files acting as links to an actual file, you can have as many symlinks as needed and removing them doesn&#8217;t affect the actual file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Softlink vs Hardlink<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following image shows a graphical representation of both the softlink vs the hardlink.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/max\/1248\/1*RG7QIumsTVILMUzsE3YyOA.jpeg\" alt=\"\"\/><figcaption>Image from <a href=\"https:\/\/miro.medium.com\/\">https:\/\/miro.medium.com\/<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Main differences between Softlink and Hardlink are listed in the following image.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/linoxide.com\/wp-content\/uploads\/2011\/05\/hard-soft-link-difference-linux.png\" alt=\"\"\/><figcaption>Image from <a href=\"https:\/\/linoxide.com\/\">https:\/\/linoxide.com\/<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Sites-Available vs Sites-Enabled<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One common use case of Symlinks is on web servers, I&#8217;ve come across with <strong>Debian <\/strong>based distros (Ubuntu) running either <strong>Apache <\/strong>or <strong>Nginx <\/strong>as web servers and both using a particular scheme to activate websites using the <strong>Sites-Available<\/strong> and <strong>Sites-Enabled<\/strong> model.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-01.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"628\" height=\"399\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-01.jpg\" alt=\"\" class=\"wp-image-5359\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-01.jpg 628w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-01-300x191.jpg 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/a><figcaption>NGINX Sites-Available and Sites-Enabled<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Under that model you can have several websites but only a few of them being served, that is quite useful if you have a website under development or just a website acting as backup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a Symlink using WinSCP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The first thing you have to get when creating a Symlink in this case to enable a website under the Debian scheme is <strong>the path to the actual file<\/strong>, that is the link to the Virtual Host configuration file, in our example that file is called &#8220;website-example&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Obtaining the path to the file is really an easy task using the WinSCP GUI, see image below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-02.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"494\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-02.jpg\" alt=\"\" class=\"wp-image-5363\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-02.jpg 675w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-02-300x220.jpg 300w\" sizes=\"auto, (max-width: 675px) 100vw, 675px\" \/><\/a><figcaption>WinSCP &#8211; getting the file path <\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to speed up this step, then you can make use of the key combination <strong>Ctrl+Alt+C<\/strong>, once you have the path on the clipboard you can go to the folder &#8220;sites-enabled&#8221; to create the Symlink, just right click and select &#8220;<strong>New\/Link<\/strong>&#8220;, see screenshot below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-03-v2.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"374\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-03-v2.jpg\" alt=\"\" class=\"wp-image-5366\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-03-v2.jpg 672w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-03-v2-300x167.jpg 300w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/a><figcaption>WinSCP creating a new Symlink<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the <strong>file path<\/strong> and also the <strong>file name<\/strong> as follow.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-04.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-04.jpg\" alt=\"\" class=\"wp-image-5368\" width=\"672\" height=\"380\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-04.jpg 672w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-04-300x170.jpg 300w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/a><figcaption><em>WinSCP creating a new Symlink<\/em> &#8211; file name and file path<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it your brand new Symlink has been successfully created.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-05.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"661\" height=\"174\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-05.jpg\" alt=\"\" class=\"wp-image-5369\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-05.jpg 661w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/05\/Linux-Symlinks_Symbolic_links-nginx-05-300x79.jpg 300w\" sizes=\"auto, (max-width: 661px) 100vw, 661px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a Symlink using the CLI<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Those of you who prefer doing things purely and always on the terminal can use the following CLI when creating Symlinks.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ln -s \/etc\/nginx\/sites-available\/website-example \/etc\/nginx\/sites-enabled\/website-example<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Where to go next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In case you want to go further on learning about WinSCP and its multiple useful tool you can take a look at the following articles.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"\/winscp-bookmarks\/\">WinSCP Bookmarks<\/a><\/li><li><a href=\"\/winscp-text-editor\/\">WinSCP text editor<\/a><\/li><li><a href=\"\/winscp-ownership-and-permissions\/\">WinSCP Ownership and Permissions<\/a><\/li><li><a href=\"\/winscp-new-session\/\">WinSCP new session<\/a><\/li><li><a href=\"\/install-winscp\/\">How to install WinSCP<\/a><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is a Symlink? Symlinks (Symbolic Links) are also known as Soft links, and they are widely used on Linux, as well as in other OS, in Windows they are called &#8220;shortcuts&#8221;, basically they are just small files acting as links to an actual file, you can have as many symlinks as needed and removing &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lamp.ciscoar.com\/?page_id=5353\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;WinSCP How to create a Symlink&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5353","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/5353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5353"}],"version-history":[{"count":16,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/5353\/revisions"}],"predecessor-version":[{"id":5381,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/5353\/revisions\/5381"}],"wp:attachment":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}