3 ms·
How do I get this?
by Jaxkr 6y ago
How do I get this?
- mic47 6y agoI have similar setup (infinite history, remember directory, shell session, ...), and then ctrl-r runs fzf that find the command first in this session, then in the same directory, then in the rest. I already hinted about that setup here: https://news.ycombinator.com/item?id=22504950 https://news.ycombinator.com/item?id=22504950 Note, that just logging your directory, time and command in text file is great help, since if you don't remember something, you can just open the file and find what you need.
- rhaps0dy 6y agoJust put: export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> "${HOME}/bash_logs_$(hostname)/bash-history-$(date "+%Y-%m-%d").log"; fi' in your ~/.bash_profile. You also may need to `mkdir "${HOME}/bash_logs_$(hostname)"` I took this command from a Hacker News thread of the past. I don't have a link to it any more.
- vardump 6y agoThere are several past posts with same bash one liner. For example https://news.ycombinator.com/item?id=14108671 https://news.ycombinator.com/item?id=14108671
- StavrosK 6y agofish does this by default, and zoxide/z can switch to frecent directories.