Table of Contents

General Bash-ery

Use Ctrl + r to reverse search command history and Ctrl + s to forward search. Esc selects the current line and restores it to the active command line. Ctrl + g cancels the history search without recalling a line to the active command line.

Add the following to the bashrc to disable the flow control function of Ctrl + s

stty -ixon # enabled forward search with Ctrl+s by disabling XON/XOFF flow control

Command Line Editing

History

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.

PROMPT_COMMAND='printf "\e[32m---------------------------$(date +%Y-%m-%dT%H:%M:%S%z)---------------------------\n\e[0m"'

Example output

---------------------------2023-04-07T21:12:28+0000---------------------------