Can I redirect a file to the terminal

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I know I can redirect all terminal output to a file, but does that work the other way around?



Can I have a terminal window open, in Tmux or elsewhere, that is receiving redirected output from a file in real time? IE if another process is writing to the file, this is being directed to a terminal window?



The reason I would like this is I would like to see the output of some code in a REPL, Erlang it turns out, which has many processes creating terminal output stuff in background, but this output is very rapid and I "lose" my REPL command line constantly as it is drowned by the output. So I'd like to output to a file instead, but in another terminal, I want to see what that output is in real time.










share|improve this question



















  • 1




    Possibly related: Displaying a “scrolling” log file
    – steeldriver
    57 mins ago










  • Interestingly, while tail -f works fine with appending to the fille using >>, if I open the file in Vim and add to it, it doesn't work. Just sayin'. Haven't tested with Erlang yet but it's coming up.
    – Thomas Browne
    49 mins ago










  • aha! I need to use -F in that case, because it appears that vim closes and then reopens the file. Okay good news. Isn't Linux foxtrot wonderful!
    – Thomas Browne
    47 mins ago















up vote
1
down vote

favorite












I know I can redirect all terminal output to a file, but does that work the other way around?



Can I have a terminal window open, in Tmux or elsewhere, that is receiving redirected output from a file in real time? IE if another process is writing to the file, this is being directed to a terminal window?



The reason I would like this is I would like to see the output of some code in a REPL, Erlang it turns out, which has many processes creating terminal output stuff in background, but this output is very rapid and I "lose" my REPL command line constantly as it is drowned by the output. So I'd like to output to a file instead, but in another terminal, I want to see what that output is in real time.










share|improve this question



















  • 1




    Possibly related: Displaying a “scrolling” log file
    – steeldriver
    57 mins ago










  • Interestingly, while tail -f works fine with appending to the fille using >>, if I open the file in Vim and add to it, it doesn't work. Just sayin'. Haven't tested with Erlang yet but it's coming up.
    – Thomas Browne
    49 mins ago










  • aha! I need to use -F in that case, because it appears that vim closes and then reopens the file. Okay good news. Isn't Linux foxtrot wonderful!
    – Thomas Browne
    47 mins ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I know I can redirect all terminal output to a file, but does that work the other way around?



Can I have a terminal window open, in Tmux or elsewhere, that is receiving redirected output from a file in real time? IE if another process is writing to the file, this is being directed to a terminal window?



The reason I would like this is I would like to see the output of some code in a REPL, Erlang it turns out, which has many processes creating terminal output stuff in background, but this output is very rapid and I "lose" my REPL command line constantly as it is drowned by the output. So I'd like to output to a file instead, but in another terminal, I want to see what that output is in real time.










share|improve this question















I know I can redirect all terminal output to a file, but does that work the other way around?



Can I have a terminal window open, in Tmux or elsewhere, that is receiving redirected output from a file in real time? IE if another process is writing to the file, this is being directed to a terminal window?



The reason I would like this is I would like to see the output of some code in a REPL, Erlang it turns out, which has many processes creating terminal output stuff in background, but this output is very rapid and I "lose" my REPL command line constantly as it is drowned by the output. So I'd like to output to a file instead, but in another terminal, I want to see what that output is in real time.







command-line redirect






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 24 mins ago

























asked 1 hour ago









Thomas Browne

106110




106110







  • 1




    Possibly related: Displaying a “scrolling” log file
    – steeldriver
    57 mins ago










  • Interestingly, while tail -f works fine with appending to the fille using >>, if I open the file in Vim and add to it, it doesn't work. Just sayin'. Haven't tested with Erlang yet but it's coming up.
    – Thomas Browne
    49 mins ago










  • aha! I need to use -F in that case, because it appears that vim closes and then reopens the file. Okay good news. Isn't Linux foxtrot wonderful!
    – Thomas Browne
    47 mins ago













  • 1




    Possibly related: Displaying a “scrolling” log file
    – steeldriver
    57 mins ago










  • Interestingly, while tail -f works fine with appending to the fille using >>, if I open the file in Vim and add to it, it doesn't work. Just sayin'. Haven't tested with Erlang yet but it's coming up.
    – Thomas Browne
    49 mins ago










  • aha! I need to use -F in that case, because it appears that vim closes and then reopens the file. Okay good news. Isn't Linux foxtrot wonderful!
    – Thomas Browne
    47 mins ago








1




1




Possibly related: Displaying a “scrolling” log file
– steeldriver
57 mins ago




Possibly related: Displaying a “scrolling” log file
– steeldriver
57 mins ago












Interestingly, while tail -f works fine with appending to the fille using >>, if I open the file in Vim and add to it, it doesn't work. Just sayin'. Haven't tested with Erlang yet but it's coming up.
– Thomas Browne
49 mins ago




Interestingly, while tail -f works fine with appending to the fille using >>, if I open the file in Vim and add to it, it doesn't work. Just sayin'. Haven't tested with Erlang yet but it's coming up.
– Thomas Browne
49 mins ago












aha! I need to use -F in that case, because it appears that vim closes and then reopens the file. Okay good news. Isn't Linux foxtrot wonderful!
– Thomas Browne
47 mins ago





aha! I need to use -F in that case, because it appears that vim closes and then reopens the file. Okay good news. Isn't Linux foxtrot wonderful!
– Thomas Browne
47 mins ago











1 Answer
1






active

oldest

votes

















up vote
2
down vote













tail -f is what I was looking for.



touch ~/foo
tail -f ~/foo


now in another terminal:



echo "hello" >> ~/foo
echo "there" >> ~/foo


Works a charm. Now some programs (vim for example) will close and reopen the file and tail -f will not work, so you will not see additions when you save from vim. In this case, use tail -F, which explicitly follows the filename rather than the descriptor.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2faskubuntu.com%2fquestions%2f1088071%2fcan-i-redirect-a-file-to-the-terminal%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
    2
    down vote













    tail -f is what I was looking for.



    touch ~/foo
    tail -f ~/foo


    now in another terminal:



    echo "hello" >> ~/foo
    echo "there" >> ~/foo


    Works a charm. Now some programs (vim for example) will close and reopen the file and tail -f will not work, so you will not see additions when you save from vim. In this case, use tail -F, which explicitly follows the filename rather than the descriptor.






    share|improve this answer
























      up vote
      2
      down vote













      tail -f is what I was looking for.



      touch ~/foo
      tail -f ~/foo


      now in another terminal:



      echo "hello" >> ~/foo
      echo "there" >> ~/foo


      Works a charm. Now some programs (vim for example) will close and reopen the file and tail -f will not work, so you will not see additions when you save from vim. In this case, use tail -F, which explicitly follows the filename rather than the descriptor.






      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        tail -f is what I was looking for.



        touch ~/foo
        tail -f ~/foo


        now in another terminal:



        echo "hello" >> ~/foo
        echo "there" >> ~/foo


        Works a charm. Now some programs (vim for example) will close and reopen the file and tail -f will not work, so you will not see additions when you save from vim. In this case, use tail -F, which explicitly follows the filename rather than the descriptor.






        share|improve this answer












        tail -f is what I was looking for.



        touch ~/foo
        tail -f ~/foo


        now in another terminal:



        echo "hello" >> ~/foo
        echo "there" >> ~/foo


        Works a charm. Now some programs (vim for example) will close and reopen the file and tail -f will not work, so you will not see additions when you save from vim. In this case, use tail -F, which explicitly follows the filename rather than the descriptor.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 40 mins ago









        Thomas Browne

        106110




        106110



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1088071%2fcan-i-redirect-a-file-to-the-terminal%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            Installing NextGIS Connect into QGIS 3?

            One-line joke