Alias in Fish

To get started with customizing fish, let's have a look on how alias works in fish. It's a bit different since you don't use the alias commando. Instead, you write a fish-function and place it in your fish-home folder.

Let's start with creating an alias for grep'ing the output from ps.

function psgrep 
   ps ax | grep -i $argv[1] | grep -v grep
end

Save the file as "psgrep.fish" and place it in "~/.config/fish/functions" (or wherever your fish-config folder is).

To reload the sources (bash-equivalent of "source ~/.bash_profile", type ". ~/.config/fish/config.fish". The same also works in any other shell since "." is short for "source". If your function is placed in the correct folder fish have already scanned the folder and loaded your new function.

To use it, type "psgrep [processname]". Voila!