You are not logged in.

#1 2014-05-04 15:51:55

spr-k3737
Member
Registered: 2013-12-30
Posts: 3

Symlink vs Alias

I just installed the firefox beta from AUR, and would like to fully replace firefox with it. My intuition is that this can be done by symlinking /usr/bin/firefox to /usr/bin/firefox-beta-bin, or by creating an equivalent alias.

Any thoughts on this choice, for this particular example or in general?

I've tried to google around for it, but most of what is coming up is about a specific technical issue, not about the best practice of each of their uses.

Last edited by spr-k3737 (2014-05-04 15:52:38)

Offline

#2 2014-05-04 16:09:03

mpan
Member
Registered: 2012-08-01
Posts: 1,207
Website

Re: Symlink vs Alias

I doubt any of them is better than the other. They're just completly different.

Symlink is global and applies to all users, at all time.
Alias is specific to a particular user and has to be set on logon.

Last edited by mpan (2014-05-04 16:09:45)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2014-05-04 16:13:50

spr-k3737
Member
Registered: 2013-12-30
Posts: 3

Re: Symlink vs Alias

I could hypothetically put the alias in /etc/profile, as some googling suggested I do, removing the user difference.

Another difference I notice is that alias is something done every session/boot/whatever, while symlink bakes it into the filesystem, and doesn't require...maintenance.

Offline

#4 2014-05-04 21:27:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Symlink vs Alias

spr-k3737 wrote:

symlink bakes it into the filesystem, and doesn't require...maintenance.

If you don't do this in the PKGBUILD, when you remove firefox beta and you forget to remove the symlink, you may be left scratching your head, why you get an error when you try to install the stock firefox or some other firefox version that does provide a symlink.

Offline

#5 2014-05-05 21:24:20

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,022

Re: Symlink vs Alias

And due how path are created, why not use /usr/local/bin/firefox ???

PD: I laugh hard for the tittle... I read "Symlinks vs Allan"


Well, I suppose that this is somekind of signature, no?

Offline

#6 2014-05-06 00:01:42

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Symlink vs Alias

Jristz wrote:

PD: I laugh hard for the tittle... I read "Symlinks vs Allan"

Symlinks are easily broken. They stand no chance against Allan.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#7 2014-05-06 03:29:06

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Symlink vs Alias

spr-k3737 wrote:

Any thoughts on this choice, for this particular example or in general?

FWIW, I would create a symlink, preferably in the PKGBUILD, for this use case.

Offline

#8 2014-05-06 04:20:34

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: Symlink vs Alias

Using an alias works if you want to access firefox in a shell or other applications that run external commands with a shell (e.g. a system() call)
A symlink covers a greater range of use cases. It also works with all other applications that search for the executable in a path to run it. (e.g. execvp)

Edit: If you want a symlink only for a specifc user, add e.g. "~/bin" to your PATH variable and create the symlink as "~/bin/firefox"

Last edited by progandy (2014-05-06 04:22:05)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB