1

I've got a referenced file called ~/.zsh/aliases. Inside this file, I have an alias:

alias la='exa --icons -lah'

In my ~/.zshrc, I have sourced this file towards to bottom of the file:

source ~/.zsh/aliases
source ~/.zsh/path
source ~/.zsh/var

However, the la command is doing a "normal" la. I've tried with other aliases and they work. For example, alias gc='exa --icons -lah' will work. But if I assign la with something else, it also doesn't work. For example, alias la='git commit' doesn't work.

It seems like la is taken and can't be overwritten.

anthonyjdella
  • 481
  • 2
  • 16
  • Stack Overflow is for programming questions. General questions about Linux and its utilities should be posted to [unix.se] or [su] instead. – John Kugelman May 20 '22 at 18:55

2 Answers2

4

For me the problem was the position of the alias inside the .zshrc file, i solved that by putting it to the bottom of the file. Hope it works for you too

fedann
  • 51
  • 3
-1

Fixed this issue by sourcing the referenced file from my terminal, rather than just inside .zshrc.

So, to work run this inside the terminal:

source ~/.zsh/aliases

Not sure why it wasn't getting picked up from .zshrc.

anthonyjdella
  • 481
  • 2
  • 16