Basis


Fish

Fish generally works like other shells, like Bash or Zsh. A few important differences can be found at https://fishshell.com/docs/current/tutorial.html by searching for the magic phrase "unlike other shells".


Config

fish_config
Open web interface to config fish.

fish_add_path /my/path/to/add
Add new path to PATH.


Alias

alias --save k="kubectl"
Create an alias (--save make permanent).

Variables


Set Variable

set MY_VAR myValue
Set variable.

-x
Export the variable (make it an environment variable, available to child processes).

-g
Global variable (available to all function in the same shell).

-U
Set "Universal" variable (available all fish instances and persist across restarts).

Structures


While

while read line; echo $line; end < myFile.txt
One liner version of while loop to read file.