recall commands previously typed in a shell or other utility

learn more… | top users | synonyms

36
votes
4answers
4k 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
5k 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 ...
20
votes
4answers
8k 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 ...
9
votes
3answers
4k 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. ...
17
votes
6answers
2k 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 ...
21
votes
4answers
24k 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
513 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
1k 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 ...
6
votes
6answers
671 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 ...
13
votes
3answers
512 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
1k 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
325 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
1k 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 .zshrc: setopt AUTO_CD setopt CORRECT_ALL setopt EXTENDED_GLOB # History SAVEHIST=10000 ...
130
votes
11answers
38k 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 ...
11
votes
8answers
387 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? ...
39
votes
12answers
8k 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
3k 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 ...