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
  


Symlinks in-depth, part 6 page 10 of 13


While this solution will work, it will create problems if we decide that we want to move both files to /usr/local/bin:


# mv /usr/bin/keychain /usr/bin/kc /usr/local/bin

Because we used an absolute path in our symbolic link, our kc symlink is still pointing to /usr/bin/keychain, which no longer exists -- another broken symlink. Both relative and absolute paths in symbolic links have their merits, and you should use a type of path that's appropriate for your particular application. Often, either a relative or absolute path will work just fine. In this case, the following example would have worked:


# cd /usr/bin
# ln -s keychain kc
# ls -l kc
lrwxrwxrwx    1 root     root            8 Jan  5 12:40 kc -> keychain

Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact