Where is terminal output stored?











up vote
0
down vote

favorite












I open lxterminal, which shows up in ps output as x-terminal-emulator. I then enter a command which prints it's output to STDOUT, which is visible on my screen. The command finishes, and I am shown another prompt.



The output of the previous command is still visible, so I can copy and paste it by GUI text selection, but I would like to be able to access it from a script.



Options for accessing this output that I can imagine:




  1. Is it stored somewhere, like in /dev?

  2. Is it in memory somewhere that I could read with low-level tools?

  3. Can I script my terminal emulator to store the output of every command while still outputting it normally?

  4. Is there a tool to scrape text from GTK windows that could access the full terminal window contents?










share|improve this question


















  • 2




    1. no 2. yes; and you can attach with gdb to any processs and read its memory. 3. script(1), tee(1). 4. no
    – mosvy
    Sep 29 at 21:00








  • 1




    Related: unix.stackexchange.com/q/109509/117549 and unix.stackexchange.com/q/370393/117549
    – Jeff Schaller
    Sep 29 at 23:16










  • similar, but neither would be a duplicate
    – Thomas Dickey
    Sep 29 at 23:30










  • For your question #3: The script command can be used to produce a log file of everything displayed on a terminal. Note that the stored data includes any terminal control characters emitted by the program that produced the output, so it may not be as easy to scrape as you might think.
    – telcoM
    Sep 30 at 5:22










  • Related: unix.stackexchange.com/q/483894
    – sondra.kinsey
    Nov 30 at 19:39















up vote
0
down vote

favorite












I open lxterminal, which shows up in ps output as x-terminal-emulator. I then enter a command which prints it's output to STDOUT, which is visible on my screen. The command finishes, and I am shown another prompt.



The output of the previous command is still visible, so I can copy and paste it by GUI text selection, but I would like to be able to access it from a script.



Options for accessing this output that I can imagine:




  1. Is it stored somewhere, like in /dev?

  2. Is it in memory somewhere that I could read with low-level tools?

  3. Can I script my terminal emulator to store the output of every command while still outputting it normally?

  4. Is there a tool to scrape text from GTK windows that could access the full terminal window contents?










share|improve this question


















  • 2




    1. no 2. yes; and you can attach with gdb to any processs and read its memory. 3. script(1), tee(1). 4. no
    – mosvy
    Sep 29 at 21:00








  • 1




    Related: unix.stackexchange.com/q/109509/117549 and unix.stackexchange.com/q/370393/117549
    – Jeff Schaller
    Sep 29 at 23:16










  • similar, but neither would be a duplicate
    – Thomas Dickey
    Sep 29 at 23:30










  • For your question #3: The script command can be used to produce a log file of everything displayed on a terminal. Note that the stored data includes any terminal control characters emitted by the program that produced the output, so it may not be as easy to scrape as you might think.
    – telcoM
    Sep 30 at 5:22










  • Related: unix.stackexchange.com/q/483894
    – sondra.kinsey
    Nov 30 at 19:39













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I open lxterminal, which shows up in ps output as x-terminal-emulator. I then enter a command which prints it's output to STDOUT, which is visible on my screen. The command finishes, and I am shown another prompt.



The output of the previous command is still visible, so I can copy and paste it by GUI text selection, but I would like to be able to access it from a script.



Options for accessing this output that I can imagine:




  1. Is it stored somewhere, like in /dev?

  2. Is it in memory somewhere that I could read with low-level tools?

  3. Can I script my terminal emulator to store the output of every command while still outputting it normally?

  4. Is there a tool to scrape text from GTK windows that could access the full terminal window contents?










share|improve this question













I open lxterminal, which shows up in ps output as x-terminal-emulator. I then enter a command which prints it's output to STDOUT, which is visible on my screen. The command finishes, and I am shown another prompt.



The output of the previous command is still visible, so I can copy and paste it by GUI text selection, but I would like to be able to access it from a script.



Options for accessing this output that I can imagine:




  1. Is it stored somewhere, like in /dev?

  2. Is it in memory somewhere that I could read with low-level tools?

  3. Can I script my terminal emulator to store the output of every command while still outputting it normally?

  4. Is there a tool to scrape text from GTK windows that could access the full terminal window contents?







terminal gtk terminal-emulator






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 29 at 20:49









sondra.kinsey

1086




1086








  • 2




    1. no 2. yes; and you can attach with gdb to any processs and read its memory. 3. script(1), tee(1). 4. no
    – mosvy
    Sep 29 at 21:00








  • 1




    Related: unix.stackexchange.com/q/109509/117549 and unix.stackexchange.com/q/370393/117549
    – Jeff Schaller
    Sep 29 at 23:16










  • similar, but neither would be a duplicate
    – Thomas Dickey
    Sep 29 at 23:30










  • For your question #3: The script command can be used to produce a log file of everything displayed on a terminal. Note that the stored data includes any terminal control characters emitted by the program that produced the output, so it may not be as easy to scrape as you might think.
    – telcoM
    Sep 30 at 5:22










  • Related: unix.stackexchange.com/q/483894
    – sondra.kinsey
    Nov 30 at 19:39














  • 2




    1. no 2. yes; and you can attach with gdb to any processs and read its memory. 3. script(1), tee(1). 4. no
    – mosvy
    Sep 29 at 21:00








  • 1




    Related: unix.stackexchange.com/q/109509/117549 and unix.stackexchange.com/q/370393/117549
    – Jeff Schaller
    Sep 29 at 23:16










  • similar, but neither would be a duplicate
    – Thomas Dickey
    Sep 29 at 23:30










  • For your question #3: The script command can be used to produce a log file of everything displayed on a terminal. Note that the stored data includes any terminal control characters emitted by the program that produced the output, so it may not be as easy to scrape as you might think.
    – telcoM
    Sep 30 at 5:22










  • Related: unix.stackexchange.com/q/483894
    – sondra.kinsey
    Nov 30 at 19:39








2




2




1. no 2. yes; and you can attach with gdb to any processs and read its memory. 3. script(1), tee(1). 4. no
– mosvy
Sep 29 at 21:00






1. no 2. yes; and you can attach with gdb to any processs and read its memory. 3. script(1), tee(1). 4. no
– mosvy
Sep 29 at 21:00






1




1




Related: unix.stackexchange.com/q/109509/117549 and unix.stackexchange.com/q/370393/117549
– Jeff Schaller
Sep 29 at 23:16




Related: unix.stackexchange.com/q/109509/117549 and unix.stackexchange.com/q/370393/117549
– Jeff Schaller
Sep 29 at 23:16












similar, but neither would be a duplicate
– Thomas Dickey
Sep 29 at 23:30




similar, but neither would be a duplicate
– Thomas Dickey
Sep 29 at 23:30












For your question #3: The script command can be used to produce a log file of everything displayed on a terminal. Note that the stored data includes any terminal control characters emitted by the program that produced the output, so it may not be as easy to scrape as you might think.
– telcoM
Sep 30 at 5:22




For your question #3: The script command can be used to produce a log file of everything displayed on a terminal. Note that the stored data includes any terminal control characters emitted by the program that produced the output, so it may not be as easy to scrape as you might think.
– telcoM
Sep 30 at 5:22












Related: unix.stackexchange.com/q/483894
– sondra.kinsey
Nov 30 at 19:39




Related: unix.stackexchange.com/q/483894
– sondra.kinsey
Nov 30 at 19:39










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Regarding number (3), you could put "script -a <file>" in your .bashrc / .bash_profile / etc. which will save all commands in your terminal session.






share|improve this answer








New contributor




Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















    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: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    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%2f472328%2fwhere-is-terminal-output-stored%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Regarding number (3), you could put "script -a <file>" in your .bashrc / .bash_profile / etc. which will save all commands in your terminal session.






    share|improve this answer








    New contributor




    Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote













      Regarding number (3), you could put "script -a <file>" in your .bashrc / .bash_profile / etc. which will save all commands in your terminal session.






      share|improve this answer








      New contributor




      Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        up vote
        0
        down vote










        up vote
        0
        down vote









        Regarding number (3), you could put "script -a <file>" in your .bashrc / .bash_profile / etc. which will save all commands in your terminal session.






        share|improve this answer








        New contributor




        Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        Regarding number (3), you could put "script -a <file>" in your .bashrc / .bash_profile / etc. which will save all commands in your terminal session.







        share|improve this answer








        New contributor




        Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered Nov 30 at 20:05









        Colin Pearse

        1




        1




        New contributor




        Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Colin Pearse is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f472328%2fwhere-is-terminal-output-stored%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt