fish(1)
fish is a user-friendly interactive shell and command language with syntax highlighting, autosuggestions, and intelligent tab completion.
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
| Flag | What it does |
|---|---|
-c, --command | Execute the specified command string and exit |
-i, --interactive | Force interactive mode even when input is not a terminal |
-l, --login | Act as a login shell; read startup files |
-n, --no-execute | Parse the script without executing it; useful for syntax checking |
-p, --profile | Output timing information for each command to the specified file |
-v, --version | Display version information and exit |
-h, --help | Display help message and exit |
--no-config | Do not load configuration files or run initialization |
--private | Run in private mode; disables history and command saving |
Examples
Start an interactive fish shell session with syntax highlighting and autosuggestions
fishExecute 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.fishStart fish as a login shell, loading ~/.config/fish/config.fish
fish -lSet fish as your default login shell (requires fish installed)
chsh -s /usr/bin/fishDisplay the definition of the fish builtin function 'cd' with syntax highlighting
type cdUse fish's powerful string manipulation builtins
builtin string match 'test' 'testing'Start fish in private mode without saving history
fish --private