recall commands previously typed in a shell or other utility

learn more… | top users | synonyms

1
vote
2answers
178 views

Specifying numeric ranges in zsh history

According to the docs I can tell the zsh history to print lines in a range. The docs say "history [first [last]]" I've tried "history a b" but that gives a too many arguments error. I've also tried ...
3
votes
1answer
55 views

Scroll to the last command on Terminal? (like OS X Terminal marks)

Mac OS X Terminal marks are incredibly useful. For example, when I type a command that echoes a lot output, it's easy to read the beginning with Cmd+Up. It will scroll to the last command and ...
3
votes
1answer
125 views

Why does history not overwrite but append when histappend is set to off in Bash?

Several days ago, I had one Terminal tab doing ssh, and the other doing a lot of work locally. And then I restarted the machine (on a Mac with Mavericks). When I ran Terminal again, I found that all ...
1
vote
1answer
26 views

Can I make history not print any timestamps for commands that were run before I enabled that option?

If you run history, it outputs the current date before commands that were run before I enabled timestamps, is there anyway I can make it ignore that? For example, if my .bash_history looks like this: ...
1
vote
1answer
122 views

Detailed history of all commands/actions (also in GUI)

The famous history command shows us a list of recently executed commands. If we set the HISTTIMEFORMAT variable we can also see when the commands where executed. I would like a more general version of ...
1
vote
1answer
213 views

How to exclude command from history list, but to keep it in “live” history?

I've meanwhile managed to keep my history a lot cleaner thanks to you guys' great tips involving the HISTIGNORE option in .bashrc, omitting all those pointless ll or df -k lines. However, I've ...
0
votes
1answer
28 views

how to make sure csh won't mess up your tcsh history timestamps?

I use tcsh as my default shell. Sometimes, I run csh (e.g., for testing), and it messes up my savehist history file, particularly, the timestamps -- lots of events end up appearing under the exact ...
3
votes
0answers
83 views

Why does “less” sometimes forget its history

I set and exported $LESSHISTFILE and $LESSHISTSIZE but if I perform a search in one less session, close, reopen it and try to repeat my last search I get "No previous regular expression (press RETURN)...
3
votes
0answers
112 views

Why can I change bash history?

Why does bash change the history even I'm not executing a command I'm modifying? For example, if I type: $ echo foo1 foo1 $ echo foo2 foo2 $ echo foo3 foo3 After this, I press up twice, and I get ...
3
votes
0answers
340 views

How to create a bash command which creates output that exactly mimics a source text file that can be pasted into bash shell where histexpand is on?

The goal is to create a bash one line command that can be copied and pasted - for instance published on a web forum - and then patches files. See it as a way to distribute a patch file by copy and ...
2
votes
0answers
50 views

Cross-session duplicate removal in bash command history

The problem context: always active ignoreboth and erasedups HIST_SIZE and FILESIZE with desired/practical limits of different history lines for our user almost always have multiple parallel sessions ...
2
votes
0answers
376 views

Tcsh: Searching history using Ctrl-P and Ctrl-N

What are the equivalent functions in tcsh for the following zsh functions? up-line-or-history history-beginning-search-backward down-line-or-history history-beginning-search-forward I have the ...
1
vote
0answers
38 views

history shows only current session

This is what I see in my terminal in a fresh session: Agent pid 6847 Identity added: /home/eric/.ssh/id_rsa (/home/eric/.ssh/id_rsa) ➜ ~ history 1 history ➜ ~ I'm using Linux Mint 17.3 ...
1
vote
0answers
43 views

Can I prevent zsh slowing with a large history?

I've just migrated from bash to zsh. I converted ~/.bash_history for use in zsh. It's 150 000 lines long. bash is almost instantaneous to start up, but zsh is now fairly slow, taking half a second to ...
1
vote
0answers
40 views

Variables in history?

Is it possible to include environment variables in the history output. Something along the lines of: %T %F $SUDO_USER $HISTORY_COMMAND 1 2015-01-01 00:00:00 USER123 echo 123 Reason being we have a ...
1
vote
0answers
180 views

Zsh: quickly bookmark commands

I just had an idea, I'm sure it must exist though I could not find anything on the web. This topic gets close to my idea but not enough: How to quickly store and access often used commands? I'd like ...
0
votes
0answers
52 views

reverse-i-search (Ctrl-r) with history -r?

I'm searching a way to reload the bash history before executing "Ctrl-r" command. Or better, complete using the .bash_history instead of the in-memory dump. Every Terminal has its "own" history but ...