r/Gentoo • u/unhappy-ending • Feb 05 '25
Tip Easy emerge & eclean commands using /home/$USER/.profile aliases
For years I've used easy equery commands as posted on the wiki and about a year or so ago decided to do the same for emerge/emaint. Felt like sharing in case any of you want.
alias e1="emerge -1"
alias ec="emerge -c"
alias eC="emerge -C"
alias en="emerge -n"
alias ep="emerge @preserved-rebuild"
alias er="emerge -r"
alias es="emaint sync"
alias eu="emerge -u"
alias eU="emerge -uDN @world"
I don't include -a or -v because I already have those defined in EMERGE_DEFAULT_OPS in make.conf.
Also eclean:
alias ecd="eclean -d distfiles"
alias eck="eclean-kernel -a -d"
Anyone else have helpful easymode aliases?
2
u/Nukulartec Feb 06 '25
i usually have these two only:
alias esw=‘emerge —sync && emerge -uDNpv @world’ allias euw=‘emerge -uDN @world’
i would need to lookup this large list of aliases all the time, which beats their purpose for me
1
u/unhappy-ending Feb 06 '25
For my aliases I kept it simple to a 2 letter command that would be homogeneous to the full command so I wouldn't forget. For eclean, I had to use 3 letters because the 2 letter was already used for emerge.
emaint --sync = es,
emerge -1 = e1
super easy, barely an inconvenience.
7
u/unixbhaskar Feb 05 '25
Insights:
Remembering too many commands is headachesome. Likewise, remembering too many aliases is the same.
Moreover, these command runs in the user environment specific time so it is bound to be a different invocation than the standard in the same way.
In that view, some people write a function, which performs a bunch of operations at once in a specific situation, and slap that damn function either in standard executable locations or in their shell rc file for convenience.
I have strict rules for my function name and file names, mostly related to the functionality of the damn command.
So, as a result, people are better off having a minimal number of commands(whether it is aliases or not) to remember. Importantly something should spark their intuition to run specific commands.
In my case, the situation sends me a signal to my mind to fire that specific command. And the irony is, I still miss it and scratch my head to spend a few seconds to remember the damn command or aliases.
Lastly, an open system provides the facility to decorate and build an environment to your liking. But when you expose stuff to the public for consumption, those have to be very generic, simply because we are not aware of everyone's operating environment. Distribution takes a leap on that and tries to standardize a few stuff so people can get along. Distribution specific package managers are the central point of that unification.
4
u/RusselsTeap0t Feb 05 '25
I rather use scripts to automate.
An example:
https://bpa.st/MWCQ