Questions tagged [command-history]
recall commands previously typed in a shell or other utility
773 questions
1 vote
0 answers
53 views
Running XFCE on Debian Trixie. Bash history is not saving any sudo commands
Bash history works OK for except for sudo commands. Code from .bashrc follows. How can I modify the behaviour to include anything starting with sudo? NOTE. This behaviour is the same with a brand new ...
0 votes
0 answers
78 views
How to use bash history on a mac?
I've got MacBook from work and try to make it work similar to Linux. This is my config for history in bash: # When the shell exits, append to the history file instead of overwriting it export ...
4 votes
2 answers
297 views
history -cw does not overwrite ~/.bash_history file
I use Arch Linux and bash. I've identified the following and can't understand how it works. The first issue is: history -cw doesn't clear ~/.bash_history file but history -c ; history -w does. The ...
0 votes
1 answer
71 views
local zsh history on up-arrow, global zsh-history on ctrl-R
I am looking for a very specific behavior in my Zsh terminals. I have multiple terminal windows open at the same time. On each terminal window, if I hit the up arrow, I'd like for it to go up through ...
1 vote
1 answer
69 views
"history-search-backward" but ignore sudo prefix in zsh?
According to this page: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html history-search-backward: "Search backward in the history for a line beginning with the first word in the buffer....
1 vote
2 answers
111 views
Up-arrow does not complete the typed command in gdb, but instead iterates through all the history
I am having trouble with gdb. When I start pushing the Up Arrow key, it iterates backwards through the history. However, if I start typing a command, like b, instead of iterating only through history ...
0 votes
1 answer
107 views
Using bash history expansion, how do I rerun the last command with a different last word?
NOTE: I plan on answering my own question. This is the last command I ran on the command line: git co head -- a/path/to/a/file.ts I want to run this a few more times but with different file paths for ...
-2 votes
1 answer
104 views
Bash setting on duplicate history lines doesn't work
Why does the Bash setting on duplication affairs not work? In .bashrc: export HISTCONTROL=erasedups:ignoredups It keeps recording ie. writing every command typed in CLI into .bash_history EDIT : That ...