Alias command wont save the aliases

So i just wanted to make some aliasPack called “Spaceman” but aliases dont rly work on another session of terminal, it’s like i use command alias but it would not work when i restart terminal or just add another tab to it ;((

You need to put aliases into ~/.bashrc to have them be persistant across sessions.

Umm, ok but how do i do it?

Like so.

alias np='nano -w PKGBUILD'
alias more=less

but im doing it like this, like u just say i should

Open up the .bashrc file, which is located in your /home/$USER/ folder. It’s hidden.

Then add the alias line to it at the bottom.

like this?
spaceman="s pacman"
(Thats my whole file)

Edit: It still dont works

Your example would be:

alias s="sudo"
alias spaceman="s pacman"
alias install="-S"
alias remove="-Ryuu"

You should do source ~/.bashrc to test it without relogging.

But, I am not sure it would work if you do spaceman install <package>, since it has 2 aliases in the same command. Never tried that.

After typing source ~/.bashsrc in terminal i got this:
/home/cartoonguy/.bashrc:type:64: bad option: -P
zsh: command not found: complete
zsh: command not found: shopt
zsh: command not found: shopt
zsh: command not found: shopt

Ah, you are running ZSH. That’s a pretty important information there, since that has nothing to do with .bashrc…


.zshrc is not empty :smiley:

should i restart my pc?

No, just log out and log back in, or run… :arrow_down:

source ~/.zshrc