Sie befinden sich hier: eisfair / Pack-Eis
News News News

Content

Dateianzeige für hstr (2.8.0)

usr/share/doc/hstr/hstr.txt
Das hstr-Paket Kommandozeilentool zur Anzeige, Bearbeitung und Sortieren der Historie der Kommandozeile und zum Starten von Kommandos aus der Historie. # hstr --help Usage: hstr [option] [arg1] [arg2]... Shell history suggest box: --favorites -f ... show favorites view --non-interactive -n ... print filtered history and exit --show-configuration -s ... show configuration to be added to ~/.bashrc --show-zsh-configuration -z ... show Zsh configuration to be added to ~/.zshrc --show-blacklist -b ... show commands to skip on history indexation --version -V ... show version details --help -h ... help Beschreibungen aller Tastenkuerzel befinden sich in der diesem Dokument angehaengten Man-Page. Es ist moeglich, die Suche in der Kommandohistorie mittels [STRG]-[R] mit diesem Kommando zu verknuepfen. hstr --show-configuration gibt diese und weitere optionale Ergaenzungen fuer die bash aus, die in der .bashrc des Users zu ergaenzen sind: # HSTR configuration - add this to ~/.bashrc alias hh=hstr # hh to be alias for hstr export HSTR_CONFIG=hicolor # get more colors shopt -s histappend # append new history items to .bash_history export HISTCONTROL=ignorespace # leading space hides commands from history export HISTFILESIZE=10000 # increase history file size (default is 500) export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500) # ensure synchronization between Bash memory and history file export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" # if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc) if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi # if this is interactive shell, then bind 'kill last command' to Ctrl-x k if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi hh --show-zsh-configuration gibt diese und weitere optionale Ergaenzungen fuer die Z-Shell aus, die in der .zshrc des Users zu ergaenzen sind: # HSTR configuration - add this to ~/.zshrc alias hh=hstr # hh to be alias for hstr export HISTFILE=~/.zsh_history # ensure history file visibility export HSTR_CONFIG=hicolor # get more colors bindkey -s "\C-r" "\eqhstr\n" # bind hstr to Ctrl-r (for Vi mode check doc) hstr-Homepage: http://github.com/dvorka/hstr Im Folgenden die Manpage von hh/hstr: ------------------------------------------------------------------------------ HSTR(1) General Commands Manual HSTR(1) NAME hstr - easily view, navigate, sort and use your command history with shell history suggest box. SYNOPSIS hstr [option] [arg1] [arg2]... DESCRIPTION hstr uses shell history to provide suggest box like functionality for commands used in the past. By default it parses .bash-history file that is filtered as you type a command substring. Commands are not just fil- tered, but also ordered by a ranking algorithm that considers number of occurences, length and timestamp. Favorite and frequently used com- mands can be bookmarked. In addition hstr allows removal of commands from history - for instance with a typo or with a sensitive content. OPTIONS -h --help Show help -n --non-interactive Print filtered history on standard output and exit -k --kill-last-command Delete the last command from history and exit -f --favorites Show favorites view immediately -s --show-configuration Show configuration that can be added to ~/.bashrc -b --show-blacklist Show blacklist of commands to be filtered out before history processing -V --version Show version information KEYS pattern Type to filter shell history. Ctrl-e Toggle regular expression and substring search. Ctrl-t Toggle case sensitive search. Ctrl-/, Ctrl-7 Rotate view of history as provided by Bash, ranked history ordered by the number of occurences/length/timestamp and favorites. Ctrl-f Add currently selected command to favorites. Ctrl-l Toggle search pattern case. Ctrl-r, UP arrow, DOWN arrow, Ctrl-n, Ctrl-p, Ctrl-j, Ctrl-k Navigate in the history list. TAB, RIGHT arrow Choose currently selected item for completion and let user to edit it on the command prompt. LEFT arrow Choose currently selected item for completion and let user to edit it in editor (fix command). ENTER Choose currently selected item for completion and execute it. DEL Remove currently selected item from the shell history. BACKSPACE, Ctrl-h Delete last pattern character. Ctrl-u, Ctrl-w Delete pattern and search again. Ctrl-x Write changes to shell history and exit. Ctrl-g Exit with empty prompt. ENVIRONMENT VARIABLES hstr defines the following environment variables: HSTR_CONFIG Configuration options: hicolor Get more colors with this option (default is monochro- matic). monochromatic Ensure black and white view. prompt-bottom Show prompt at the bottom of the screen (default is prompt at the top). no-confirm Do not ask for confirmation on a history entry delete (default is with confirmation). regexp-matching Filter command history using regular expressions. substring-matching Filter command history using substring. keywords-matching Filter command history using keywords - item matches if contains all keywords in pattern in any order (keywords match is default). case-sensitive Make history filtering case sensitive (it's case insen- sitive by default). raw-history-view Show normal history as a default view (metric-based view is shown otherwise). favorites-view Show favorites as a default view (metric-based view is shown otherwise). static-favorites Do not put recently used favorite to the head of favorites (favorites are reordered by default). skip-favorites-comments Skip comments (lines beginning with #) when loading ~/.hstr_favorites (all lines are loaded by default). duplicates Show duplicates in rawhistory (duplicates are discarded by default). verbose-kill Print the last command command deleted from history (nothing is printed by default). blacklist Load list of commands to skip when processing history from ~/.hstr_blacklist (built-in blacklist used otherwise). keep-page Don't clear page with command selection on exit (page is cleared by default). big-keys-skip Skip big history entries i.e. very long lines (default). big-keys-floor Use different sorting slot for big keys when building metrics-based view (big keys are skipped by default). big-keys-exit Exit (fail) on presence of a big key in history (big keys are skipped by default). warning Show warning. debug Show debug information. Example: export HSTR_CONFIG=hicolor,regexp-matching,raw-history- view HSTR_PROMPT Change prompt string which is user@host$ by default. Example: export HSTR_PROMPT="$ " FILES ~/.hstr_favorites Bookmarked favorite commands. ~/.hstr_blacklist Commands to be hidden. BASH CONFIGURATION Optionally add the following lines to ~/.bashrc: alias hh=hstr # hh to be alias hstr export HSTR_CONFIG=hicolor # get more colors shopt -s histappend # append new history items to .bash_history export HISTCONTROL=ignorespace # leading space hides commands from history export HISTFILESIZE=10000 # increase history file size (default is 500) export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500) # ensure synchronization between Bash memory and history file export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" # if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc) if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi ZSH CONFIGURATION Optionally add the following lines to ~/.zshrc: export HISTFILE=~/.zsh_history # ensure history file visibility export HSTR_CONFIG=hicolor # get more colors bindkey -s "\C-r" "\eqhstr\n" # bind hstr to Ctrl-r (for Vi mode check doc, experiment with --) EXAMPLES hstr git Start hstr and show only history items containing 'git'. hstr cpp add git Start hstr and show only history items containing 'cpp', 'add' and 'git'. hstr --non-interactive git Print history items containing 'git' to standard output and exit. hstr --show-configuration >> ~/.bashrc Append default hstr configuration to your Bash profile. hstr --show-blacklist Show blacklist configured for history processing. AUTHOR Written by Martin Dvorak BUGS Report bugs to https://github.com/dvorka/hstr/issues SEE ALSO history(1), bash(1), zsh(1) HSTR(1) ------------------------------------------------------------------------------ Marcus Roeckrath, 2018-09-06