Recover lost terminal command after session crash

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question




















  • I guess there is no way to recover them
    – Arpit Agarwal
    Nov 11 '17 at 20:55














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.







share|improve this question




















  • I guess there is no way to recover them
    – Arpit Agarwal
    Nov 11 '17 at 20:55












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.







share|improve this question












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.









share|improve this question











share|improve this question




share|improve this question










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
















  • 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










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. If HISTFILE 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. If HISTFILESIZE 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






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    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






























    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. If HISTFILE 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. If HISTFILESIZE 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






    share|improve this answer


























      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. If HISTFILE 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. If HISTFILESIZE 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






      share|improve this answer
























        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. If HISTFILE 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. If HISTFILESIZE 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






        share|improve this answer














        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. If HISTFILE 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. If HISTFILESIZE 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







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 13 '17 at 11:56

























        answered Nov 12 '17 at 4:42









        igal

        4,830930




        4,830930



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay