Stored terminal commands?
When using terminal, you can use up and down arrow keys to scroll through previous commands entered as the user. What file is this list stored in if I wished to print it?
|
use the command history to print them. And they are stored in the following location /<username>/.bash_history. So for the root user it'll be /root/.bash_history
|
Hi,
It stored at /home/"username"/.bash_history But this file is hidden, so you need to issue Quote:
And you can list it with the Quote:
If you want to use any command again which previously used, you could use the !"number here" to rerun the command again. e.g.: Quote:
Laz |
Note, though, that the shell (well, bash at least) updates that file only when the shell exits. As long as the shell is running, it just updates its internal copy of the command history.
|
Incidentally, extending post#3, you can also use
Code:
!tail |
Quote:
I didn't know this one. |
ha, of course, .bash_history, it's been way too long since I worked with the shell :(
Thanks for the other tips too. |
All times are GMT -5. The time now is 09:10 AM. |