Skip to content Gå til innhold


How to create a symlink (shortcut) in Linux Hvordan lage en symlink (snarvei) i Linux

Linux

Symlinks or symbolic links are the Linux equivalent of shortcuts in Windows. Symlinks eller symbolske lenker er Linux tilsvarer snarveier i Windows. Creating symlinks of files or folders can be quite useful in Linux, as you can shorten a path such as /var/www/html/application/configuration/images/config.php to something easier to remember and manage such as /var/www/html/image-config.php . Opprette symlinks av filer eller mapper kan være ganske nyttig i Linux, som du kan forkorte en bane som / var / www / html / application / konfigurering / images / config.php til noe lettere å huske og håndtere for eksempel / var / www / html / bilde-config.php. Let's see how this can be done. La oss se hvordan dette kan gjøres.

Use the following command to create such a symlink: Bruk følgende kommando for å opprette en slik symlink:

# ln -s /var/www/html/application/configuration/images/config.php /var/www/html/image-config.php # Ln-s / var / www / html / application / konfigurering / images / config.php / var / www / html / bilde-config.php

What we have done here is that we have created a symbolic link, /var/www/html/image-config.php , to /var/www/html/application/configuration/images/config.php . Hva vi har gjort her er at vi har opprettet en symbolsk lenke / var / www / html / bilde-config.php, til / var / www / html / application / konfigurering / images / config.php. You can verify if the symlink was created correctly by running the following command: Du kan kontrollere om symlink ble opprettet på riktig måte ved å kjøre følgende kommando:

# ls -all /var/www/html/image-config.php # Ls-all / var / www / html / bilde-config.php
lrwxrwxrwx 1 calvin calvin 37 Apr 29 16:41 image-config.php -> /var/www/html/application/configuration/images/config.php lrwxrwxrwx 1 Calvin Calvin 37 29 april 16:41 image-config.php -> / var / www / html / application / konfigurering / images / config.php

If you are administering a Linux server symlinks can make your life a lot easer and it is something you should definitely familiarize yourself with. Hvis du administrere en Linux server symlinks kan gjøre livet ditt mye easer og det er noe du bør definitivt gjøre deg kjent med. The easy way to remember the symlink syntax is: Den enkle måten å huske symlink syntaks er:

# ln -s <source> <destination link> # Ln-s <kilde> <destination link>

Posted in Posted in Linux Linux . .

Related Posts: Relaterte innlegg:

How to save the output of a Linux command to a file Hvordan lagre utdata fra en Linux-kommandoen til en fil
How to encrypt your Linux backups Hvordan kryptere Linux sikkerhetskopier
How to block an IP address in IPTables in Linux Slik blokkerer en IP-adresse i iptables på Linux
How to use your Nokia N95 as a wireless Webcam Hvordan bruke din Nokia N95 som en trådløs Webcam
How to prevent your SSH session from disconnecting in Linux Hvordan hindre at SSH økt fra frakobling i Linux

0 Responses 0 Responses

Stay in touch with the conversation, subscribe to the Hold kontakten med samtalen, abonnere på RSS feed for comments on this post RSS feed for kommentarer til dette innlegget . .



Some HTML is OK Some HTML is OK

or, reply to this post via eller svare på dette innlegget via trackback styrekule . .