If you want to create an alias or create a link (soft/hard) of an executable or even a function, you should consider that the name you want to use is already existing in your PATH or the alias/function is already define.
check for the aliases in your system
alias
check for the functions in your system.
set
check for an executable is in your PATH,
type -a «command»
«command» can be ls,grep or any other command/executable you use.
help type
for more info.
The common mistake is create an alias, function, executable that is named test since it is a shell builtin according to
type -a test
If you want to know which get executed first, the PATH executable or the builtin see.
On Tue, 30 Sep 2014 19:16:01 +0000, razirazo wrote:
> Ooh its that simple actually. thanks.
>
> so I rename it to ‘up’. Will it possibly conflict with any other
> existing important application (that i might install later)?
Possibly, it would be impossible to enumerate every possible executable
you /might/ install and whether or not any given name you choose to use
is going to conflict with it.
That way, the alternative name is available only to me, and won’t confuse all of the other users of the system (all zero of them, as it happens). It seems better to make such changes local rather than global.
On 2014-09-30 21:16, razirazo wrote:
>
> Ooh its that simple actually. thanks.
>
> so I rename it to ‘up’. Will it possibly conflict with any other
> existing important application (that i might install later)?
Open a terminal, type “up”, then press tab twice. Then enter “su -”, give password, and repeat the
procedure.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))
> But I realy wonder how many times a day you are usuing this. Running
> things as root must be an exception in a normal stable system.
For that reason, what I do is open a terminal, and enter “su -”, and leave it there… as I
hibernate every day, it stays opens for weeks.
Sometimes, from that xterm I open other xterms, which thus run as root as well. Sometimes I can have
dozens of them. It is easier than starting several xterms and typing the password on each one.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))
I concur to your conclusion. But specialy because it is not true that there are zero other users on he system. There more then twenty of them (look in /etc/passwd) and some of them (specialy root) are used for running prcocesses (deamons or other). So changing/adding names that may be used by those users (specialy when they are executables found in the PATH of such users) can be harmfull.
> I concur to your conclusion. But specialy because it is not true that
> there are zero other users on he system. There more then twenty of them
> (look in /etc/passwd) and some of them (specialy root) are used for
> running prcocesses (deamons or other). So changing/adding names that may
> be used by those users (specialy when they are executables found in the
> PATH of such users) can be harmfull.
Good point.
And that reminds me, that “/usr/local/bin/” is not always in the path, specially for root.
Also, there are many scripts that specify the full path to whatever they call.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))
On 10/01/2014 08:18 AM, Carlos E. R. wrote:
> On 2014-10-01 13:56, hcvv wrote:
>
>> I concur to your conclusion. But specialy because it is not true that
>> there are zero other users on he system. There more then twenty of them
>> (look in /etc/passwd) and some of them (specialy root) are used for
>> running prcocesses (deamons or other). So changing/adding names that may
>> be used by those users (specialy when they are executables found in the
>> PATH of such users) can be harmfull.
>
> Good point.
>
>
> And that reminds me, that “/usr/local/bin/” is not always in the path,
> specially for root.
> Also, there are many scripts that specify the full path to whatever they
> call.
>
Which is why using a local .alias file is the best approach to creating
your own “shortcut” commands.
On 2014-10-01 14:46, hcvv wrote:
>
> robin_listas;2667371 Wrote:
>>
>> And that reminds me, that “/usr/local/bin/” is not always in the path,
>> specially for root.
>>
> It should never be in root’s PATH. Same for any other “system” user.
Well, it is where programs I build locally go to, and I need them.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Elessar))
/usr/local/bin is in the PATH for system wide users including root ( at least in my system it is )
It is where local scripts/binary/executable that sysadmins/users and not for packages AFAIK, kinda like /etc/systemd for local purposes and /usr/libsystemd/system for packages ( i hope )
> /usr/local/bin is in the PATH for system wide users including root ( at
> least in my system it is )
>
> It is where local scripts/binary/executable that sysadmins/users and not
> for packages AFAIK, kinda like /etc/systemd for local purposes and
> /usr/libsystemd/system for packages ( i hope )
Not users: only the sysadmin can install there.
Thus, if you build, say, “bash” locally, without creating an rpm, and
install it, it goes to /usr/local by default. All users would run that
version instead of the distribution version. Root would still run the
distribution version - because of the ordering of path for both.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)
Im deploying lots of PC for some proof-of-concept project spanning several computer lab; where there are multiple type of PC with different configurations that I need to install one by one before full deployment from disk image.
Sounds more like something to be done from the CLI, on the real console and no login in the GUI at all. But this comment is only made without knowing any details about what you are doing.
My original remark was based on my own experiences (with can of course differ widely from your’s) and on using KDE. I use YaST from the KDE menu as important tool for actions to be done as root (thus no kdesu (the KDE equivalent of gomesu), just clicking. And for CLI actions I use Terminal in Superuser Mode (or similar wording, it starts Konsole with an su -) from the KDE menu. Again only click.
Apart for the fact that I use the CLI for checking/testing actions to post here when answering people, I do not use it very much. About the same for YaST. In a system that is in production, I will do YaST about once a week for updating software. So even when I had to use gnomesu, it wouldn’d be worth for me to make an alias.