Difference between revisions of "Bash history"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 2: Line 2:
  
 
Variables to control Bash History:
 
Variables to control Bash History:
* HISTFILE<ref><https://www.gnu.org/software/bash/manual/bash.html#index-HISTFILE</ref>: The default value is ~/.bash_history
+
* HISTFILE<ref><https://www.gnu.org/software/bash/manual/bash.html#index-HISTFILE</ref>: The default value is <code>~/.bash_history</code>
 
* HISTFILESIZE
 
* HISTFILESIZE
 
* HISTTIMEFORMAT<ref>https://www.gnu.org/software/bash/manual/bash.html#index-HISTTIMEFORMAT</ref>
 
* HISTTIMEFORMAT<ref>https://www.gnu.org/software/bash/manual/bash.html#index-HISTTIMEFORMAT</ref>

Revision as of 12:07, 28 March 2020

Bash Command history feature allows to recall, edit and rerun previous commands. Also allows commands to be saved using the history -a command[1][2].

Variables to control Bash History:

  • HISTFILE[3]: The default value is ~/.bash_history
  • HISTFILESIZE
  • HISTTIMEFORMAT[4]

Usage

  • Basic example:
export PROMPT_COMMAND='history -a'


Activities

  1. Install https://github.com/ohmybash bash customization

See also

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Source: https://en.wikiversity.org/wiki/Bash_programming/Bash_History

Advertising: