Questions tagged [command-history]
Questions relating to the command history features of command-line shells like Windows' CMD and Bash on Unix-based systems - features that store and deal with previously-executed shell commands.
139
questions
3
votes
2
answers
1k
views
Remove Internet Explorer Address Bar URL History from Run dialogue?
How do I prevent Internet Explorer's address bar's URL history from showing up in the Run dialogue? No tweak seems to prevent this. I'm running Windows 8.
16
votes
1
answer
2k
views
How can you reverse the direction of alt-period in Bash?
In Bash, you can press Alt-. to insert the last argument of the previous command. If you press it multiple times, it cycles through the last arguments of all of the commands in your history. However, ...
10
votes
4
answers
6k
views
How to selectively navigate through Bash command history on a Linux terminal [duplicate]
Everyone knows (or should know!) that on a terminal the up and down arrow keys are used to navigate through the history of used commands.
When you use the terminal on a daily basis, your command ...
3
votes
1
answer
4k
views
How to log bash command with its output?
I want the actual command line be logged together with its output.
I routinely execute important commands like this:
PERL5LIB=${PERL5LIB}:/something/extra my-command.pl many arguments which I want ...
1
vote
3
answers
880
views
Copy all users' .bash_history in one go
Is it possible to use cp to copy every user's .bash_history file into the same folder (with the username appended)?
Or is it at least possible to copy them into a parallel set of folders? I can't ...
1
vote
1
answer
3k
views
How to set history length for msys?
On my Debian VM I'm setting the $HISTSIZE and $HISTFILESIZE (and other history related environment variables) on system start / profile load:
~/.profile
export HISTSIZE=100000
export HISTFILESIZE=...
3
votes
4
answers
367
views
Unix-like command-line shells: Get full command input/output history
I'm looking to see if there is some smooth way (that is, not me just writing a wrapper for the shell) to get full logs of both everything I enter into the command-line shell and everything that gets ...
11
votes
4
answers
24k
views
To know which IP executed a certain command in linux using ssh
There is a server which is accessed by many users using ssh. I am trying to figure out which user executed a certain command.
I can know the list of users currently accessing server using who
Also I ...
38
votes
4
answers
26k
views
bash save history without exit
in linux ubuntu bash terminal. is there any way to save bash history without writing exit?
i've set the config to
"HISTCONTROL=erasedups"
which in my opinion works better than ignoredups.
anyways ...
3
votes
1
answer
615
views
put in bash or zsh history absolute path to files I working on
I have found that in bash i frequently use something like that:
vim ./somefile1 less
less ./dir1/dir2/somefile2
cp some_other_relative_path_to_file
and so on
After that when I trying to find a ...
2
votes
3
answers
1k
views
How to start bash and immediately "type" command into it?
I want bash to first execute a command, but after the command finishes (or Ctrl+C'ed) go into interactive mode (preferrably with the command in history, available for up).
How to attain it in easiest ...
2
votes
1
answer
467
views
How to enable the bash history only caching commands that are acutally in path?
Having a bash history enabled is a security risk, because when you accientally enter your password into the bash the password gets stored in the bash history. To prevent this a good solution would be ...
1
vote
1
answer
1k
views
How to enable command history in Run, without enabling recently opened programs history in start menu?
I want to enable command history in Run dialog box, without enabling recently opened programs history in start menu?
(!) This previous answer will enable history in both Run and Start Menu (recently ...
4
votes
1
answer
15k
views
How to enable command history in Run command dialog box? [duplicate]
Possible Duplicate:
Enable history for Run dialog for Vista administrator
In my PC (running Windows 7 Professional - 64 bit), the Run dialog box does not keep the history of previous commands! So ...
7
votes
2
answers
1k
views
Vim-like history in bash?
In bash, it's possible to scroll through the command history using the up and down keys. In vim, this is also possible (after pressing :). But with vim, if you type the first few letters of a previous ...
3
votes
1
answer
1k
views
How to log in which terminal session a zsh command was run
In zsh's history file, all commands are logged from all terminal sessions. Is there any way to log in which terminal session a command was run (i.e., a unique identifier for this instance of the shell?...
3
votes
2
answers
1k
views
Delete current command
Is there a keyboard shortcut to delete the current command?
Let's say I have:
$ cp /home/one/two/tree/ /var/www/one/two/three
I want to easily the current command, specially when it's long and I ...
11
votes
2
answers
1k
views
Change the order of Windows shell command history retrieval
One of the things that drive me crazy in command line under MS-Windows is the order in which the Windows shell (both the standard one and PowerShell) retrieve commands from history when you use the up ...
1
vote
1
answer
215
views
how to speed up my .bash_history commands
I use my .bash_history all the time using ctrl-R to find complex commands I figured out in the past and since forgot how to run.
I have a large history (50,000) lines, managed by these commands in my ...
1
vote
1
answer
1k
views
Does Linux save the history of executed commands
I know we can do a "history" command or use control+R to find the command history in a particular shell session. But is there a way to find out the command history of my last ssh session for example?
...
36
votes
7
answers
9k
views
Separate up arrow lookback for local and global ZSH history
Is it possible to...
Step up local ZSH shell history (actions only happened in that prompt)
Step up global ZSH history (shared history is on) - default what happens when you press UP arrow when ...
1
vote
1
answer
347
views
How to append to bash history before showing the prompt if the line isn't a duplicate?
Because it seems often the history isn't saved when shutting down and not closing gnome terminal, I'd like to append to bash history before showing the prompt if the line isn't a duplicate. Although I ...
59
votes
2
answers
48k
views
oh-my-zsh history completion
I have recently switched to zsh, using robbyrussell's oh-my-zsh. Before that i used bash with a lot of custom stuff and i am only missing one thing because zsh is trying to be 'too smart':
If i type ...
56
votes
3
answers
44k
views
Command history in zsh
Currently I have zsh set up in such a way that command history is shared between all sessions immediately.
Say I have a terminal emulator open with two tabs, each with a zsh session, A1 and A2. If I ...
1
vote
1
answer
2k
views
trying to get .csh history via arrow keys
I was wondering if there was a easy way to get the up and down arrows to scroll command history while in .csh?I know that it is done like that in bash and sort of use to being able to work that way
0
votes
1
answer
193
views
Command history for user never using interactive shell
Can I view the history of a non-interactive user, for example, httpd? Hopefully, the answer is not specific to the shell used. I'm looking for history that could be in either bash or dash.
1
vote
1
answer
177
views
Accessing your bash profile and history anywhere - via the internet
I'm curious if anyone has tried to tackle the task of having non-sensitive parts of their bash (or other shell) profile made available anywhere they go.
I worked for a company for a time that did ...
3
votes
1
answer
1k
views
Bash alias history substitution similar to \!* in csh
My question is very similar to that of this old post.
I would like to do something similar: place in an alias the last argument(s) typed on the current command line. This would be equivalent to the ...
1
vote
2
answers
430
views
Repeat last command matching "two words" zsh
I want to repeat the last command that matches foo bar. Using !! doesn't work (it's not the last command I used), and neither does !foo, because my history looks something like
foo bar dee zep
foo ...
179
votes
12
answers
181k
views
Remove a certain line from Bash history file
How can I remove a certain line from history's database?
2
votes
1
answer
139
views
can I use wrap a command inside a history-aware script?
Suppose I have a command line interface tool that doesn't have any notion of 'history'. Would it be possible to write a small script that merely does readlines and forwards them to the tool, but that ...
2
votes
1
answer
912
views
Record all commands
I am learning ruby and following tutorials in a book. I want to record all the commands i enter in shell( I am using zsh) . How can I do that? I should be able to stop and start recording.
7
votes
1
answer
4k
views
When and how is bash_history appended to?
As far as I can tell, the history of an individual shell is only appended to the .bash_history file when the shell is closed. This means that I frequently lose individual shells' histories on crashes ...
7
votes
1
answer
461
views
Custom prompt botched during history and control-a in OS X's Terminal.app using Bash
I customized my prompt in .bash_profile to look like this:
export PS1="\w \e[0;32m\$(vcprompt -f '[%n:%b]')\e[m\$ "
Now, when I press up arrow to go back through history, find the one I want, then ...
16
votes
2
answers
9k
views
Windows Command Prompt: How to change the size of command history window?
Pressing F7 in the Windows command prompt window displays a console window with the command history (list of previous commands). How do I change the size of this command history window?
For example, ...
51
votes
7
answers
339k
views
How to view command history of another user in Linux?
How can I view the command history of another user?
I am an admin on my machine. I can see normal history by viewing /home/user_name/.bash_history but I can't see commands of that user_name when ...
29
votes
2
answers
32k
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 ...
2
votes
1
answer
2k
views
Map reverse-history-search function in bash to a shortcut other than CTRL+R
I'm using Putty Connection Manager which captures CTRL-R key before it can get to my bash shell.
So I was wondering if it is possible to map the reverse-history-search to another shortcut key. Such ...
46
votes
5
answers
14k
views
How can I add a command to the Bash history without executing it?
Every now and then it would be useful to add a command directly to the history in Bash without actually executing it. So far the closed thing I have found is adding a # in front of it and hitting ...