What Is the Use of Script Command in Linux?
Contents Script Command in Linux Is Used to Make Typescript or Record All the Terminal Activities. After Executing the Script Command It Starts Recording...
Contents
script command in Linux is used to make typescript or record all the terminal activities. After executing the script command it starts recording everything printed on the screen including the inputs and outputs until exit.
What is the use of script command in Unix?
The Unix script command.
script is used to take a copy of everything which is output to the terminal and place it in a log file. It should be followed by the name of the file to place the log in, and the exit command should be used to stop logging and close the file.
Must Read
How do I run a script in Linux?
Steps to write and execute a script
- Open the terminal. Go to the directory where you want to create your script.
- Create a file with . sh extension.
- Write the script in the file using an editor.
- Make the script executable with command chmod +x <fileName>.
- Run the script using ./<fileName>.