Duplicate output of a program [duplicate]

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











up vote
2
down vote

favorite













This question already has an answer here:



  • Redirect script output to /dev/tty1 and also capture output to file

    2 answers



Sometimes you want to have the output in a special file. So you can do something like this:



ls > test.txt


But sometimes I want to have the output also on my command line, for example when the program takes additional input and you want to see what the program wants you to input.



How this can be done?







share|improve this question












marked as duplicate by Jeff Schaller, Archemar, Kiwy, Christopher, Hauke Laging Apr 4 at 18:45


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • You could have used Google
    – Debian_yadav
    Mar 25 at 10:41














up vote
2
down vote

favorite













This question already has an answer here:



  • Redirect script output to /dev/tty1 and also capture output to file

    2 answers



Sometimes you want to have the output in a special file. So you can do something like this:



ls > test.txt


But sometimes I want to have the output also on my command line, for example when the program takes additional input and you want to see what the program wants you to input.



How this can be done?







share|improve this question












marked as duplicate by Jeff Schaller, Archemar, Kiwy, Christopher, Hauke Laging Apr 4 at 18:45


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • You could have used Google
    – Debian_yadav
    Mar 25 at 10:41












up vote
2
down vote

favorite









up vote
2
down vote

favorite












This question already has an answer here:



  • Redirect script output to /dev/tty1 and also capture output to file

    2 answers



Sometimes you want to have the output in a special file. So you can do something like this:



ls > test.txt


But sometimes I want to have the output also on my command line, for example when the program takes additional input and you want to see what the program wants you to input.



How this can be done?







share|improve this question













This question already has an answer here:



  • Redirect script output to /dev/tty1 and also capture output to file

    2 answers



Sometimes you want to have the output in a special file. So you can do something like this:



ls > test.txt


But sometimes I want to have the output also on my command line, for example when the program takes additional input and you want to see what the program wants you to input.



How this can be done?





This question already has an answer here:



  • Redirect script output to /dev/tty1 and also capture output to file

    2 answers









share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 20:07









Henry Weinert

1163




1163




marked as duplicate by Jeff Schaller, Archemar, Kiwy, Christopher, Hauke Laging Apr 4 at 18:45


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Jeff Schaller, Archemar, Kiwy, Christopher, Hauke Laging Apr 4 at 18:45


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • You could have used Google
    – Debian_yadav
    Mar 25 at 10:41
















  • You could have used Google
    – Debian_yadav
    Mar 25 at 10:41















You could have used Google
– Debian_yadav
Mar 25 at 10:41




You could have used Google
– Debian_yadav
Mar 25 at 10:41










1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










You can do it with tee:



ls | tee test.txt






share|improve this answer



























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted










    You can do it with tee:



    ls | tee test.txt






    share|improve this answer
























      up vote
      4
      down vote



      accepted










      You can do it with tee:



      ls | tee test.txt






      share|improve this answer






















        up vote
        4
        down vote



        accepted







        up vote
        4
        down vote



        accepted






        You can do it with tee:



        ls | tee test.txt






        share|improve this answer












        You can do it with tee:



        ls | tee test.txt







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 at 20:16









        Jesse_b

        10.4k22658




        10.4k22658












            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)