recall commands previously typed in a shell or other utility
3
votes
2answers
307 views
Where is the setting that disallows duplicate command history?
Let's say I type the following sequence of commands:
$ cd
$ ls
$ ls
When I go back in history by pressing up twice, I end up with cd, instead of ls.
I've noticed this isn't always the case, so it ...
6
votes
2answers
2k views
Why would anyone not set 'histappend' in bash?
After finding out what this shopt -s histappend means, it seems a very sane setting, and I'm surprised that it isn't default. Of course I may be shortsighted, so why would anyone not use such a ...
7
votes
4answers
779 views
Can I easily search my history across many screen windows?
My current screen session has 12 open windows on it. It's been running for weeks... I know I executed an ImageMagick convert command in one of these 12 screen windows sometime last week... is there ...
26
votes
4answers
2k views
Is there any way to keep a command from being added to your history?
Is there any way to keep a command from being added to your history? I have a command that I want to keep out of my history file, and I really don't care to have it there when I search the history ...
5
votes
3answers
2k views
History command inside bash script
I have been bashing my head to write a simple history script for the last two days. History is a shell-built in command I couldn't able to use that within a BASH script. So, Is there a way attain this ...
10
votes
4answers
2k views
Command-line completion from command history
So, I've looked at history and at Ctrl+R, but they are not what I thought I knew.
Is there a way that I can type in the beginning of a command, and cycle through the matches in my history with some ...
6
votes
2answers
2k views
How to properly escape exclamation points in bash?
Today, I was caught redhanded while attempting to code golf a password generator for Twitter.
import string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))
90 chars. ...
11
votes
6answers
817 views
put history command onto command line without executing it
I use !n where (n) is the line number for executing a line in the history file I want executed at the command prompt which I find via history|less.
But there is a command line history event I wish ...
8
votes
4answers
8k views
Understanding the exclamation mark (!) in bash
I used
history | less
to get the lines of previous commands and from the numbers on the left hand side I found the line I wanted repeated (eg. 22) and did
!22
at the command prompt and it ...
5
votes
5answers
299 views
Would it be possible to jump between prev/next command prompts?
I'm using zsh in OS X Terminal.app and for quite a while, I've been longing for a way to jump back and forth between prev/next prompts in the terminal's output.
One convenience with this would be to ...
5
votes
1answer
609 views
How to get a persistent “history”-file even after a non-clean shutdown?
I am trying Ubuntu Server 10.10 in VirtualBox. I like that the commands I run is saved in a "history"-file that can be shown with the history command. But if I just turn off VirtualBox without the ...
4
votes
5answers
280 views
How can I reproduce commands run on one machine on another machine?
I would like to install some software on a linux-machine that I have run in VirtualBox. Then I would like to do the same thing on a linux-VPS.
I think that I can save all commands that I run using ...
8
votes
3answers
303 views
Mangled history
In gui mode, when a user has more than one terminal open, how do the terminals rewrite the history file of that user? the reason I ask is because, it is quite possible that in each of the terminals ...
6
votes
1answer
609 views
What does the 'a' attribute in lsattr mean?
I was trying to remove some old history from my .bash_history file, but I was receiving this message:
[john ~] /home/john $ mv .bash_history .bas
mv: impossible to move `.bash_history' to `.bas': ...
0
votes
0answers
323 views
bash: recall command by typing some characters of it [duplicate]
Possible Duplicate:
best way to search my shell's history
In MSDOS I have the option to start typing some characters of a previous command and then pressing F8 it will search the ...
1
vote
2answers
795 views
Extending history search in zsh
How to extend Ctrl+R search in zsh? It cannot find entry despite it is in history file.
Edit: My .zsh:
setopt AUTO_CD
setopt CORRECT_ALL
setopt EXTENDED_GLOB
# History
SAVEHIST=10000
...
51
votes
9answers
9k views
Preserve bash history in multiple terminal windows
I consistently have more than one terminal open. Anywhere from two to ten, doing various bits and bobs. Now let's say I restart and open up another set of terminals. Some remember certain things, some ...
10
votes
8answers
348 views
How to access the history on the fly in unix?
for example, if I do a
mkdir thisismyfolder912
I remember there is some easier way to switch to thisismyfolder912 than having to do a
cd thisismyfolder912
What is that way and how does it work? ...
31
votes
12answers
2k views
best way to search my shell's history
Is there a better way to search my history file for a command than grep? I do have some idea what the command starts as, but I don't know how far back in the history it is.
update: was formerly zsh ...
5
votes
4answers
2k views
How to have separate command history for different sessions for the same user?
I face this issue on some of Unix servers. When I open different session for same user, command history is shared by all the session. This creates issues if by mistake I press Ctrl-P or up arrow and ...