linux:general_bash-ery

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:general_bash-ery [2023/03/28 00:54] – [General Bash-ery] mguptonlinux:general_bash-ery [2023/04/10 11:35] (current) – [Command Delimiter] mgupton
Line 25: Line 25:
   * ''history -a'', append the current session history to the history file   * ''history -a'', append the current session history to the history file
   * ''history -s <cmd line>'', save the specified command line to history without executing it. Alternatively, prefix a line with the comment character (#) and it will be saved to history as a comment.   * ''history -s <cmd line>'', save the specified command line to history without executing it. Alternatively, prefix a line with the comment character (#) and it will be saved to history as a comment.
 +
 +====== Command Delimiter ======
 +Automatically run a command after every command ran in the shell that prints a line that includes the current time. It makes it easier to spot commands being ran when scrolling back in the terminal.
 +<code bash>
 +PROMPT_COMMAND='printf "\e[32m---------------------------$(date +%Y-%m-%dT%H:%M:%S%z)---------------------------\n\e[0m"'
 +</code>
 +
 +Example output
 +<code>
 +---------------------------2023-04-07T21:12:28+0000---------------------------
 +</code>
  
  • linux/general_bash-ery.1679964841.txt.gz
  • Last modified: 2023/03/28 00:54
  • by mgupton