$linuxjunkies
>

fish(1)

fish is a user-friendly interactive shell and command language with syntax highlighting, autosuggestions, and intelligent tab completion.

UbuntuDebianFedoraArch

Synopsis

fish [OPTIONS] [FILE] [ARGUMENTS]

Description

fish (friendly interactive shell) is a modern shell designed around user experience. It provides real-time syntax highlighting, autosuggestions based on command history and man pages, and context-aware tab completion without requiring configuration files.

Unlike bash or zsh, fish uses a simpler syntax inspired by Python and Ruby, making it easier to learn and write scripts. It executes login scripts automatically and includes built-in functions for common tasks.

Common options

FlagWhat it does
-c, --commandExecute the specified command string and exit
-i, --interactiveForce interactive mode even when input is not a terminal
-l, --loginAct as a login shell; read startup files
-n, --no-executeParse the script without executing it; useful for syntax checking
-p, --profileOutput timing information for each command to the specified file
-v, --versionDisplay version information and exit
-h, --helpDisplay help message and exit
--no-configDo not load configuration files or run initialization
--privateRun in private mode; disables history and command saving

Examples

Start an interactive fish shell session with syntax highlighting and autosuggestions

fish

Execute a single command in fish and return to the previous shell

fish -c 'echo Hello World'

Check syntax of a fish script without executing it

fish -n script.fish

Start fish as a login shell, loading ~/.config/fish/config.fish

fish -l

Set fish as your default login shell (requires fish installed)

chsh -s /usr/bin/fish

Display the definition of the fish builtin function 'cd' with syntax highlighting

type cd

Use fish's powerful string manipulation builtins

builtin string match 'test' 'testing'

Start fish in private mode without saving history

fish --private

Related commands