Another advantage of using alias: `which [alias]` actually tells you what that alias is mapped to, and not just the location of a script in your bin folder.
which gdb /opt/homebrew/bin/gdb
~ type gdb gdb is aliased to `gdb -q'
__git_complete grm _git_rm
grm() {
git rm "${@}"
}
Internally git uses the __git_complete function to set up completions for its subcommands, though this may be specific to your OS/distro and perhaps or git version.This does seem to ship as part of git now, here[1].
[1]: https://github.com/git/git/blob/6a64ac7b014fa2cfa7a69af3c253...
~ ▸ which k
k: aliased to kubectl
`type` is a builtin on both fish and bash though, and does resolve aliases.
[edit] TIL: `zsh` has its own `which`.
Fedora does it. It's very convenient.