Anyone created bash alias with space in the alias?


i have used .bash_aliases file for my aliases on my previous Linux, but on Manjaro i somehow adding my aliases to the top of the .bashrc (system-wide aliases are said Bash - ArchWiki to belong to /etc/bash.bashrc)

Now i see that pamac does not remove orphans and unneeded packages when doing “pamac remove package”. So i was thinking to fix this by adding alias to my .bashrc:

alias "pamac remove"='pamac remove --unneeded --orphans'

It is not possible? But i think it is not a big problem, since i hope the cleanup cron script i am using should delete it anyway.

alias is a command, which enables a replacement of a word with another string.

Emphasis mine.
You could name your alias pamac-remove instead.


Or, use something like this:

alias pmacr='...'

That way, it’s a conscious decision to use it…odds of fat-fingering are greatly reduced.

That’s what I do; I also have a .bash_functions file for my simple shell functions (both sourced thru .bashrc).

1 Like