Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
\section history history - Show and manipulate command history
2012-06-05 12:24:42 +08:00
\subsection history-synopsis Synopsis
2014-08-01 20:25:41 +08:00
\fish{synopsis}
2014-08-27 02:19:24 +08:00
history ( --merge | --save | --clear )
history ( --search | --delete ) [ --prefix "prefix string" | --contains "search string" ]
2014-08-01 10:37:32 +08:00
\endfish
2012-06-05 12:24:42 +08:00
\subsection history-description Description
2014-08-01 10:37:32 +08:00
`history` is used to list, search and delete the history of commands used.
2012-06-05 12:24:42 +08:00
Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
The following options are available:
2014-08-08 10:44:37 +08:00
- `--merge` immediately incorporates history changes from other sessions. Ordinarily `fish` ignores history changes from sessions started after the current one. This command applies those changes immediately.
2014-08-19 20:41:23 +08:00
2014-08-01 12:16:02 +08:00
- `--save` saves all changes in the history file. The shell automatically saves the history file; this option is provided for internal use.
2014-08-19 20:41:23 +08:00
2014-08-01 12:16:02 +08:00
- `--clear` clears the history file. A prompt is displayed before the history is erased.
2014-08-19 20:41:23 +08:00
2016-05-28 20:22:16 +08:00
- `--search` returns history items in keeping with the `--prefix` or `--contains` options. Without either, `--contains` will be assumed.
2014-08-19 20:41:23 +08:00
2016-05-28 20:22:16 +08:00
- `--delete` deletes history items. Without the `--prefix` or `--contains` options, the exact match will be deleted. With either of these options, a prompt will be displayed before any items are deleted.
2014-08-19 20:41:23 +08:00
2014-08-01 12:16:02 +08:00
- `--prefix` searches or deletes items in the history that begin with the specified text string.
2014-08-19 20:41:23 +08:00
2014-08-01 12:16:02 +08:00
- `--contains` searches or deletes items in the history that contain the specified text string.
2012-06-05 12:24:42 +08:00
Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
\subsection history-examples Example
2012-06-05 12:24:42 +08:00
2014-08-19 20:41:23 +08:00
\fish
history --clear
# Deletes all history items
2012-06-05 12:24:42 +08:00
2014-08-19 20:41:23 +08:00
history --search --contains "foo"
# Outputs a list of all previous commands containing the string "foo".
2012-06-05 12:24:42 +08:00
2014-08-19 20:41:23 +08:00
history --delete --prefix "foo"
# Interactively deletes the record of previous commands which start with "foo".
\endfish