.. _commands: Commands ============ This is a list of all the commands fish ships with. Broadly speaking, these fall into a few categories: Keywords ^^^^^^^^ Core language keywords that make up the syntax, like - :doc:`if ` and :doc:`else ` for conditions. - :doc:`for ` and :doc:`while ` for loops. - :doc:`break ` and :doc:`continue ` to control loops. - :doc:`function ` to define functions. - :doc:`return ` to return a status from a function. - :doc:`begin ` to begin a block and :doc:`end ` to end any block (including ifs and loops). - :doc:`and `, :doc:`or ` and :doc:`not ` to combine commands logically. - :doc:`switch ` and :doc:`case ` to make multiple blocks depending on the value of a variable. - :doc:`command ` or :doc:`builtin ` to tell fish what sort of thing to execute - :doc:`time ` to time execution - :doc:`exec ` tells fish to replace itself with a command. - :doc:`end ` to end a block Tools ^^^^^ Builtins to do a task, like - :doc:`cd ` to change the current directory. - :doc:`echo ` or :doc:`printf ` to produce output. - :doc:`set_color ` to colorize output. - :doc:`set ` to set, query or erase variables. - :doc:`read ` to read input. - :doc:`string ` for string manipulation. - :doc:`path ` for filtering paths and handling their components. - :doc:`math ` does arithmetic. - :doc:`argparse ` to make arguments easier to handle. - :doc:`count ` to count arguments. - :doc:`type ` to find out what sort of thing (command, builtin or function) fish would call, or if it exists at all. - :doc:`test ` checks conditions like if a file exists or a string is empty. - :doc:`contains ` to see if a list contains an entry. - :doc:`eval ` and :doc:`source ` to run fish code from a string or file. - :doc:`status ` to get shell information, like whether it's interactive or a login shell, or which file it is currently running. - :doc:`abbr ` manages :ref:`abbreviations`. - :doc:`bind ` to change bindings. - :doc:`complete ` manages :ref:`completions `. - :doc:`commandline ` to get or change the commandline contents. - :doc:`fish_config ` to easily change fish's configuration, like the prompt or colorscheme. - :doc:`random ` to generate random numbers or pick from a list. Known functions ^^^^^^^^^^^^^^^^ Known functions are a customization point. You can change them to change how your fish behaves. This includes: - :doc:`fish_prompt ` and :doc:`fish_right_prompt ` and :doc:`fish_mode_prompt ` to print your prompt. - :doc:`fish_command_not_found ` to tell fish what to do when a command is not found. - :doc:`fish_title ` to change the terminal's title. - :doc:`fish_greeting ` to show a greeting when fish starts. - :doc:`fish_should_add_to_history ` to determine if a command should be added to history Helper functions ^^^^^^^^^^^^^^^^ Some helper functions, often to give you information for use in your prompt: - :doc:`fish_git_prompt ` and :doc:`fish_hg_prompt ` to print information about the current git or mercurial repository. - :doc:`fish_vcs_prompt ` to print information for either. - :doc:`fish_svn_prompt ` to print information about the current svn repository. - :doc:`fish_status_to_signal ` to give a signal name from a return status. - :doc:`prompt_pwd ` to give the current directory in a nicely formatted and shortened way. - :doc:`prompt_login ` to describe the current login, with user and hostname, and to explain if you are in a chroot or connected via ssh. - :doc:`prompt_hostname ` to give the hostname, shortened for use in the prompt. - :doc:`fish_is_root_user ` to check if the current user is an administrator user like root. - :doc:`fish_add_path ` to easily add a path to $PATH. - :doc:`alias ` to quickly define wrapper functions ("aliases"). - :doc:`fish_delta ` to show what you have changed from the default configuration. - :doc:`export ` as a compatibility function for other shells. Helper commands ^^^^^^^^^^^^^^^ fish also ships some things as external commands so they can be easily called from elsewhere. This includes :doc:`fish_indent ` to format fish code and :doc:`fish_key_reader ` to show you what escape sequence a keypress produces. The full list ^^^^^^^^^^^^^ And here is the full list: .. toctree:: :glob: :maxdepth: 1 cmds/*