In: Computer Science
Answer)
script is a very useful command in Linux, it records all the terminal command,outputs in a particular file.
We will login with putty to the Linux server, then type
script pp1.txt
so all the command and output are saved in the file pp1.txt. after the script pp1.txt is typed
to exit from the script command type exit. Then cat the pp1.txt file to view the output.
Screenshot
In the screenshot check
I type script pp1.txt
then the script is started, and the command date, echo "hello" and their output is records in pp1.txt
Then I type exit
Then I type cat pp1.txt
All the commands and output of date and echo "hello" are displayed.