2025-03-14 21:59:59 -06:00
|
|
|
# fish
|
|
|
|
|
|
|
|
|
|
> The Friendly Interactive SHell, a command-line interpreter designed to be user friendly.
|
2025-09-14 18:48:49 -06:00
|
|
|
> More information: <https://fishshell.com/docs/current/cmds/fish.html>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Start an interactive shell session:
|
|
|
|
|
|
|
|
|
|
`fish`
|
|
|
|
|
|
|
|
|
|
- Start an interactive shell session without loading startup configs:
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`fish {{[-N|--no-config]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Execute specific commands:
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`fish {{[-c|--command]}} "{{echo 'fish is executed'}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Execute a specific script:
|
|
|
|
|
|
|
|
|
|
`fish {{path/to/script.fish}}`
|
|
|
|
|
|
|
|
|
|
- Check a specific script for syntax errors:
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`fish {{[-N|--no-execute]}} {{path/to/script.fish}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Execute specific commands from `stdin`:
|
|
|
|
|
|
|
|
|
|
`{{echo "echo 'fish is executed'"}} | fish`
|
|
|
|
|
|
|
|
|
|
- Start an interactive shell session in private mode, where the shell does not access old history or save new history:
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`fish {{[-P|--private]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Define and export an environmental variable that persists across shell restarts (builtin):
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`set {{[-U|--universal]}} {{[-x|--export]}} {{variable_name}} {{variable_value}}`
|