user1097772
user1097772

Reputation: 3529

Copy output of the program to the screen and also to the file

I have written client-server application in C. I run the server in linux. I need to do simple logs of what server do. I print it to the screen. Please how can I copy output of the screen also to the file. Thx

Upvotes: 2

Views: 323

Answers (2)

codaddict
codaddict

Reputation: 454960

You can use the tee command as:

./server_program | tee server.log

Upvotes: 2

kev
kev

Reputation: 161614

You can use the tee command:

$ ./program | tee log.txt

Upvotes: 2

Related Questions