Recover lost terminal command after session crash
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Some days ago I was executing a rather long command using Guake (downloading a website with wget
, with an intricate set of options). I suspended my laptop before the operation was finished, and did not use it for a few days. Unfortunately, my battery discharged. After logging in again, the command does not appear in the .bash_history
file, so it does not show up in Guake or another terminal when using âÂÂ.
Is there a way I can recover this command? Is it perhaps written somewhere else? There seems to be no equivalent to bash history in the Guake folder.
terminal command-history guake
add a comment |Â
up vote
2
down vote
favorite
Some days ago I was executing a rather long command using Guake (downloading a website with wget
, with an intricate set of options). I suspended my laptop before the operation was finished, and did not use it for a few days. Unfortunately, my battery discharged. After logging in again, the command does not appear in the .bash_history
file, so it does not show up in Guake or another terminal when using âÂÂ.
Is there a way I can recover this command? Is it perhaps written somewhere else? There seems to be no equivalent to bash history in the Guake folder.
terminal command-history guake
I guess there is no way to recover them
â Arpit Agarwal
Nov 11 '17 at 20:55
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Some days ago I was executing a rather long command using Guake (downloading a website with wget
, with an intricate set of options). I suspended my laptop before the operation was finished, and did not use it for a few days. Unfortunately, my battery discharged. After logging in again, the command does not appear in the .bash_history
file, so it does not show up in Guake or another terminal when using âÂÂ.
Is there a way I can recover this command? Is it perhaps written somewhere else? There seems to be no equivalent to bash history in the Guake folder.
terminal command-history guake
Some days ago I was executing a rather long command using Guake (downloading a website with wget
, with an intricate set of options). I suspended my laptop before the operation was finished, and did not use it for a few days. Unfortunately, my battery discharged. After logging in again, the command does not appear in the .bash_history
file, so it does not show up in Guake or another terminal when using âÂÂ.
Is there a way I can recover this command? Is it perhaps written somewhere else? There seems to be no equivalent to bash history in the Guake folder.
terminal command-history guake
asked Nov 11 '17 at 11:21
luchonacho
3721417
3721417
I guess there is no way to recover them
â Arpit Agarwal
Nov 11 '17 at 20:55
add a comment |Â
I guess there is no way to recover them
â Arpit Agarwal
Nov 11 '17 at 20:55
I guess there is no way to recover them
â Arpit Agarwal
Nov 11 '17 at 20:55
I guess there is no way to recover them
â Arpit Agarwal
Nov 11 '17 at 20:55
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
No, there probably is no way for you to recover that command. By default, the ~/.bash_history
file is written to only when you exit your shell session. Here is a relevant passage from the Bash Manual:
When a shell with history enabled exits, the last
$HISTSIZE
lines are copied from the history list to the file named by$HISTFILE
. If thehistappend
shell option is set (see Bash Builtins), the lines are appended to the history file, otherwise the history file is overwritten. IfHISTFILE
is unset, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated to contain no more than$HISTFILESIZE
lines. IfHISTFILESIZE
is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated.
That said, there are things you can do if you want to avoid this situation from occurring in the future. You may want to add something like the following to your ~/.bash_profile
:
shopt -s histappend
export HISTSIZE=-1
export HISTFILESIZE=-1
PROMPT_COMMAND='history -a;history -n'
For further discussion of this topic, see the following posts:
Is it possible to make writing to .bash_history immediate?
Unlimited Bash History
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
No, there probably is no way for you to recover that command. By default, the ~/.bash_history
file is written to only when you exit your shell session. Here is a relevant passage from the Bash Manual:
When a shell with history enabled exits, the last
$HISTSIZE
lines are copied from the history list to the file named by$HISTFILE
. If thehistappend
shell option is set (see Bash Builtins), the lines are appended to the history file, otherwise the history file is overwritten. IfHISTFILE
is unset, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated to contain no more than$HISTFILESIZE
lines. IfHISTFILESIZE
is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated.
That said, there are things you can do if you want to avoid this situation from occurring in the future. You may want to add something like the following to your ~/.bash_profile
:
shopt -s histappend
export HISTSIZE=-1
export HISTFILESIZE=-1
PROMPT_COMMAND='history -a;history -n'
For further discussion of this topic, see the following posts:
Is it possible to make writing to .bash_history immediate?
Unlimited Bash History
add a comment |Â
up vote
1
down vote
accepted
No, there probably is no way for you to recover that command. By default, the ~/.bash_history
file is written to only when you exit your shell session. Here is a relevant passage from the Bash Manual:
When a shell with history enabled exits, the last
$HISTSIZE
lines are copied from the history list to the file named by$HISTFILE
. If thehistappend
shell option is set (see Bash Builtins), the lines are appended to the history file, otherwise the history file is overwritten. IfHISTFILE
is unset, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated to contain no more than$HISTFILESIZE
lines. IfHISTFILESIZE
is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated.
That said, there are things you can do if you want to avoid this situation from occurring in the future. You may want to add something like the following to your ~/.bash_profile
:
shopt -s histappend
export HISTSIZE=-1
export HISTFILESIZE=-1
PROMPT_COMMAND='history -a;history -n'
For further discussion of this topic, see the following posts:
Is it possible to make writing to .bash_history immediate?
Unlimited Bash History
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
No, there probably is no way for you to recover that command. By default, the ~/.bash_history
file is written to only when you exit your shell session. Here is a relevant passage from the Bash Manual:
When a shell with history enabled exits, the last
$HISTSIZE
lines are copied from the history list to the file named by$HISTFILE
. If thehistappend
shell option is set (see Bash Builtins), the lines are appended to the history file, otherwise the history file is overwritten. IfHISTFILE
is unset, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated to contain no more than$HISTFILESIZE
lines. IfHISTFILESIZE
is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated.
That said, there are things you can do if you want to avoid this situation from occurring in the future. You may want to add something like the following to your ~/.bash_profile
:
shopt -s histappend
export HISTSIZE=-1
export HISTFILESIZE=-1
PROMPT_COMMAND='history -a;history -n'
For further discussion of this topic, see the following posts:
Is it possible to make writing to .bash_history immediate?
Unlimited Bash History
No, there probably is no way for you to recover that command. By default, the ~/.bash_history
file is written to only when you exit your shell session. Here is a relevant passage from the Bash Manual:
When a shell with history enabled exits, the last
$HISTSIZE
lines are copied from the history list to the file named by$HISTFILE
. If thehistappend
shell option is set (see Bash Builtins), the lines are appended to the history file, otherwise the history file is overwritten. IfHISTFILE
is unset, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated to contain no more than$HISTFILESIZE
lines. IfHISTFILESIZE
is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated.
That said, there are things you can do if you want to avoid this situation from occurring in the future. You may want to add something like the following to your ~/.bash_profile
:
shopt -s histappend
export HISTSIZE=-1
export HISTFILESIZE=-1
PROMPT_COMMAND='history -a;history -n'
For further discussion of this topic, see the following posts:
Is it possible to make writing to .bash_history immediate?
Unlimited Bash History
edited Nov 13 '17 at 11:56
answered Nov 12 '17 at 4:42
igal
4,830930
4,830930
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403889%2frecover-lost-terminal-command-after-session-crash%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I guess there is no way to recover them
â Arpit Agarwal
Nov 11 '17 at 20:55