1
vote
3answers
65 views

How can I reset an edited history line in Bash?

In Bash, you can press the up (and down) arrow to traverse through history. You can then modify the command before executing it. Sometimes I've incorrectly modified the command, and wish to reset it ...
0
votes
0answers
8 views

Bash history lost [duplicate]

My bash history in cygwin is lost between two consecutive shells. Here are the outputs of some commands that might help to understand the issue: set -o | grep history history on $ grep -i ...
2
votes
2answers
43 views

How to look at the past directory history the shell was in?

Sometimes I like to look back in the command history to figure out what I was doing. Sometimes it would help to know what the cwd was for each command. So, I'm wondering if there's some way to track ...
5
votes
3answers
270 views

BASH history lost on reboot

For some reason, I cannot get my system to keep my BASH history after a reboot. Here are the relevant sections of my ~/.bashrc: shopt -s histappend PROMPT_COMMAND='history -a; updateWindowTitle' ...
3
votes
4answers
46 views

Save command to history without executing in bash

Is there a way to save a command in bash history without executing it? e.g. $ cmd [a long list of arguments] and now during typing i remember I'd like to do something else first. Can I have ...
0
votes
0answers
23 views

Storing the current working directory information with history in bash?

Bash history only stores the commands used and time. Is there any way to store where the commands are invoked? such as 1 2013-02-27 13:21:38 ls ~/SCRATCH 2 2013-02-27 13:21:38 cd ~/SCRATCH
1
vote
2answers
76 views

What determines what shows up in the bash history command?

When I run history, I get a list of commands. However, it does not appear to be complete, even for a given period of time. (It doesn't feel like it has continuous coverage of the past N commands - it ...
2
votes
3answers
66 views

change the first word of the previous command

For example I enter cat /very/long/path/textfile and right after that I decide to give the next command rm /very/long/path/textfile So, my question is: What is the easiest/fastest way to replace ...
2
votes
1answer
104 views

Record bash_history to private database for all users?

I want to be able to setup a MySQL database and record all commands issued on my server by username and command. Is this possible, and if so, how would I set it up?
2
votes
1answer
102 views

Figuring out how my /etc/ folder got deleted [closed]

I was playing around with my sendmail configuration in the /etc/ folder, and then, somehow, the contents of my /etc/ folder went away, and I'm unsure of how. From /var/log/auth.log: Nov 8 10:28:42 ...
1
vote
1answer
56 views

mapping cntrl+p , cntrl +n in command prompt

I m looking for a way to map CNTRL+p and CNTRL+n in command prompt to previous and next command in history. I m aware of F3 and up/down key but I m habituated to CNTRL+p/n on linux.
0
votes
1answer
210 views

using history command with ssh and getting output with correct time stamps [duplicate]

Possible Duplicate: using history command with ssh and getting output with time stamps Basically i want to get a record of all commands executed on my ssh server, with their correct ...
0
votes
2answers
446 views

using history command with ssh and getting output with time stamps

Basically i want to get a record of all commands executed on my ssh server, with their times. The codes i have tried are : ssh user@ip 'export HISTFILE=~/.bash_history; set -o history; history' I ...
0
votes
1answer
247 views

How to make bash remember history of previous sessions?

I have MacOSX but this should be *NIX-generic. In my computer at work, my bash shell remembers history from previous sessions, even if I just opened a new terminal. In my computer at home, this ...
7
votes
1answer
658 views

How to get infinite command history in bash?

I set export HISTSIZE=99999999999999 but is that the best way? I don't know if an overflow might occur. I'm looking for a tested, reliable way to remove command history limits.
3
votes
1answer
2k views

Retrieve Linux command line history by date

I want to see what I typed on my bash command line on a certain day a week ago. Is there a way to retrieve command line history? Something like below, perhaps? > history --include-date | grep ...
5
votes
3answers
337 views

Per-directory bash/zsh history log files

I find I do a lot of work on a project in a set directory. Sometimes - a few months down the track, I need to redo something on that project but I can't remember what the hell I did. I use mercurial ...
2
votes
1answer
195 views

Re-run command with prepended text from bash history

How do I repeat the last bash command with some text pre-pended to the front of it. So if the previous command was: $ ls /somedir I want to run the following command utilizing the bash history to ...
5
votes
2answers
795 views

Execute a terminal command without saving it to .bash_history on OS X?

This site says that on Linux you can add a space before a terminal command to keep it out of .bash_history. This does not seem to work for Mac OS X. Does anyone know of a way to execute a single ...
10
votes
2answers
388 views

How to prevent Bash from altering history?

If I press the Up or Down arrows on my keyboard and then modify something from my history, it's changed forever. Even if I press Ctrl-C and then try to bring it up again, it's still changed -- I've ...
8
votes
3answers
790 views

Is there a directory history for bash?

Is there something like bash's reverse-search-history (Ctrl-r), but for only directories? I have some deep folder hierarchies that I want to jump to, so I'd like to use something like ...
4
votes
1answer
2k views

How can I see a timestamp for when a command was executed using history?

I'd like to check at what time/date a command in bash history was executed. Is this possible?
5
votes
2answers
460 views

reverse history search with regular expressions

I'm looking for a tool to allow reverse incremental searching with simple regular expression (or just multiple matches) support. For example, if I want to find the command 'foo bar baz', I could do ...
1
vote
3answers
1k views

HISTSIZE not being set in bash

I am trying to increase the size of my history in bash. I have the following in my ~/.bash_profile # Control the command history export HISTFILESIZE=10000 export HISTSIZE=10000 export ...
0
votes
1answer
236 views

Can I create a device in linux that is actually a memory-mapped file?

I want to speed up access to my .bash_history file. I have my PROMPT_COMMAND set to do history -a; history -r, so there is a significant delay in getting a new prompt. I want to see if I can speed ...
1
vote
1answer
528 views

How to get down-arrow history browsing in bash in Mac OS X Terminal?

On almost all modern command-line environments I've used, you can hit up arrow to go back a few commands in your history and re-run an earlier command. But on some command-line environments I've ...
1
vote
1answer
111 views

Bash exeute command from history and pull next/previous command into command line

I'm sure I read it somewhere, but I cannot find the site any more. Basically I want to search the history "^r" and then execute a command and leave me at the next/previous position in the history. ...
1
vote
2answers
406 views

In GNU Screen, Recalled bash history command displays one character position to the left of actual location

I am running Red Hat 5 32-bit (2.6.18-194.26.1.el5). The issue is that when I recall any previous command in bash's history, the first character in the command is displayed immediately after the ...
5
votes
1answer
445 views

bash: per-command history. How does it work?

OK. I have an old G5 running Leopard and a Dell running Ubuntu 10.04 at home and a MacPro also running Leopard at work. I use Terminal.app/bash a lot. On my home G5 it exhibits a nice feature: using ...
6
votes
4answers
2k views

How do I keep my bash history across sessions?

I am working on a x86 target running fedora 9. Whenever I reboot it, my history returns to some state, and I do not have commands I did in the sessions before the reboot. What I have to change to ...
1
vote
3answers
890 views

How to get Bash shell history range

How can I get/filter history entries in a specific range? I have a large history file and frequently use history | grep somecommand Now, my memory is pretty bad and I also want to see what else I ...
3
votes
5answers
2k views

Terminal *output* history?

I make extensive use of the functions to navigate through the command history in my terminal; I wonder if there is some way to navigate the command output history as well? (besides keeping a large ...
8
votes
2answers
13k views

How can I check the user command history in Unix?

I know the 'history' command give me a list of the commands I have typed into the Unix terminal. How do I see the command history for all of the users currently logged onto the system?
2
votes
1answer
2k views

get bash history from another shell instance [duplicate]

Possible Duplicate: Can history files be unified in bash? I have bash running in an ssh session, call this session A. I leave the office, go home, ssh to the same box, call this session B. ...
3
votes
2answers
790 views

Sometimes my .bash_history gets cleared. Why? How can I prevent that?

Here's my shell: $ $SHELL --version | head -1 GNU bash, version 4.1.7(2)-release (i386-apple-darwin10.3.0) Here are my history related settings: export HISTCONTROL=ignoredups:erasedups export ...
4
votes
2answers
5k views

(reverse-i-search) in bash

I usually end up using CTRL+r for (reverse-i-search), however, sometimes I pass the command that I was looking for; if I do again a (reverse-i-search) it doesn't find it anymore. I assume that the ...
4
votes
1answer
309 views

bash command history update before execution of command

Bash's command history is great, especially it is useful when adding the history -a command to the COMMAND_PROMPT. However, I'm wondering if there is a way to log the commands to a file as soon as ...
1
vote
1answer
148 views

Displaying what `history` line is current in bash prompt

What formatting character needs to be added to a bash prompt to indicate the most recent history item run (or the current command number if 1 could be added to the last history entry)? My prompt ...
2
votes
1answer
1k views

bash history is appended, but histappend is off

I'm on ubuntu 10.4 and my shell is bash. When I open several gnome terminals and close them history is properly appended. When I enter shopt it says among other things: histappend off Can ...
5
votes
4answers
9k views

How can I see Bash history from more than one terminal session in Ubuntu? [duplicate]

Possible Duplicate: Can history files be unified in bash? I use Ubuntu Server 9.10 and I would like to be able to see my bash history for more than one terminal sessions. I.e. my last 200 ...
5
votes
2answers
976 views

How can I set my BASH history scrolling to filter by what I've already typed?

Given a history of commands: 1 pwd 2 mysql -u root -p 3 ps -ef | more 4 top 5 mysql -h 192.168.1.101 -u root -p When you press the Up arrow, you scroll through all those commands. I've read it ...
9
votes
4answers
1k views

Bash history loss

I like to keep a lot of history, so I have histappend set in my .bashrc. Most of the time everything works fine, with history built up from many shells appending. However, every once and a while, I'll ...