Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Linux : Education - Tutorials
LPI certification 101 exam prep, Part 1
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
4. Creating links and removing files
  


Symbolic links, continued page 4 of 13


A symbolic link can be created by passing the -s option to ln.


$ ln -s secondlink thirdlink
$ ls -l firstlink secondlink thirdlink
-rw-rw-r--    2 agriffis agriffis        0 Dec 31 19:08 firstlink
-rw-rw-r--    2 agriffis agriffis        0 Dec 31 19:08 secondlink
lrwxrwxrwx    1 agriffis agriffis       10 Dec 31 19:39 thirdlink -> secondlink

Symbolic links can be distinguished in ls -l output from normal files in three ways. First, notice that the first column contains an l character to signify the symbolic link. Second, the size of the symbolic link is the number of characters in the target (secondlink in this case). Third, the last column of the output displays the target filename.


Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact