LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   links? (https://www.linuxquestions.org/questions/linux-newbie-8/links-190854/)

name_in_use450 06-07-2004 06:28 PM

links?
 
Can someone please show me how links work? As in diff between hard and soft, commands used, and when to use them as opposed to an alias.

thanks.

leonscape 06-07-2004 07:05 PM

symlinks or soft links, are used to make either a file appear to be somwhere its not, or have a diffrent name. The command to create them is ln -s. softlinks are basically like shortcuts, and are files that simply point somewhere else.

Hard links are very rarely used, but actually point to a files inode data. All normal files are hardlinks. When you add a hardlink, the files inode structure increments a counter. so the file won't actually be deleted untill both hard links are removed. ln without the -s will create hardlinks.

alias is used primarily for altering the way commands behave by giving them options, or creating variations of commands. i.e

alias ls='ls --color=auto'
alias ll='ls -l'

so when you type ls you actually get ls --color-auto, and ll gets ls --color=auto -l.

It shouldn't be used like a link at all.


All times are GMT -5. The time now is 07:24 PM.