|
|
|
|
|
by buu700
1541 days ago
|
|
Currently, I'll append a comment to a frequently used command for easy searching from my history. For a simple example, I can access `git diff -w ; git diff -w --cached # gitdiff` by pressing Ctrl+R and typing `# gitd`. For commands I use frequently or that are clunky to maintain as one-liners, I'll convert them into functions in my bashrc. This seems like the best of both worlds in many ways, or at least is a great third option to have. |
|
> I log shell commands with a script called usrlog.sh that creates [per-]$USER and per-virtualenv tab-delimited [$_USRLOG] logfiles with unique per-terminal-session identifiers [$_TERM_ID] and ISO8601 timestamps; so it's really easy to just grep for the apt/yum/dnf commands that I ran ad-hoc when I should've just taken a second to create an Ansible role with `ansible-galaxy init ansible-role-name ` and referenced that in a consolidated system playbook with a `when` clause. https://westurner.github.io/dotfiles/usrlog.html#usrlog
usrlog.sh: https://github.com/westurner/dotfiles/blob/master/scripts/us...