Linux – Define an alias in fish shell


I would like to define some aliases in fish. Apparently it should be possible to define them in


but they don't get auto loaded when I restart the shell. Any ideas?

Best Solution

Just use alias. Here's a basic example:

# Define alias in shell
alias rmi "rm -i"

# Define alias in config file
alias rmi="rm -i"

# This is equivalent to entering the following function:
function rmi
    rm -i $argv

# Then, to save it across terminal sessions:
funcsave rmi

This last command creates the file ~/.config/fish/functions/

Interested people might like to find out more about fish aliases in the official manual.