Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux script commands - terminal recorder     - Brief Linux commands (Linux)

- Between the two to achieve the main MySQL database synchronization from (Database)

- Oriented C ++ test-driven development (Programming)

- Batch download files using the explorer under Windows Server 2008 R2 (Server)

- 10 useful tools for Linux users (Linux)

- Ordinary users how the Linux system shutdown (Linux)

- MBR partitions under Linux (Linux)

- Java 8 stream parsed into SQL (Programming)

- Java String and StringBuffer and StringBuilder Comments (Programming)

- Visual Studio Code experience (Linux)

- Linux source code to install Apache and solutions to common errors (Server)

- Migu online music player for Linux (Linux)

- Get and Post requests Comments (Linux)

- How do I delete a NEEDS RECOVERY rollback state of undo tablespace (Database)

- Spark read more HBase tables a RDD (Server)

- Why is better than Git SVN (Linux)

- Setting Squid successful anti-hotlinking (Linux)

- CentOS 7 source code to compile and install PHP5.6 Nginx1.7.9 and MySQL (LNMP build environment) (Server)

- Docker build their own private warehouses (Linux)

- JavaScript Advanced Programming notes event capture and event bubbling (Programming)

  Linux script commands - terminal recorder
  Add Date : 2018-11-21      
  When you work in a terminal or console, you may want to record everything done in the terminal. These records can be used as historical data, save all terminals happened. For example, you and a number of Linux administrators to manage the same machine, or you let someone remotely login to your server, you may want to record what happened in the end. To achieve this goal, you can use the script command.

What is the script

scirpt is a command, you can make a record output to record the terminal. For those who want a true record terminal sessions, this is very useful. The recording can be saved and later printed.

how to use

By default, we can enter the script in a terminal to start scirpt command.

pungki @ dev-machine: ~ $ script
Script started, file is typescript
pungki @ dev-machine: ~ $
You can also specify the destination file name to print the results record.

pungki @ dev-machine: ~ $ script myfile

When you see the command prompt again, this means that the terminal will record anything printed to the terminal.

You will see the current directory, there is a file named myscript. (LCTT Annotation, where the original is wrong. This specifies a log file named myfile, instead of the default typescript.)

Why do we use script commands

As already mentioned before, the main function is to record the script command all things. Here are two scenarios using this command.

And when working with colleagues

When colleagues work together, we can record your activities through the script.

For example, we'll use to print the file named collaborate to complete the print:

$ Script collaborate

Then, to complete some task, if you do you need to live send another engineer, then put the document issued to him. So when another engineer needs to review much of what he had to do to open the file with a text editor on the line.

If he wants to update the file (to increase his part of the work), you can use the -a option.

$ Script -a collaborate

Record someone's actions in the terminal

You may make your engineer or someone remote access to your system, make sure that your engineers are doing the right thing, you can record what he does on your system. Let the script command runs automatically when you log in, we can add it into the shell environment configuration file. If you are using the bash shell, add this line to your bash environment configuration file.

$ Vi ~ / .profile
# Run the script command to record everything
# Use -q for quite and -a option to append the script
/ Usr / bin / script -qa / usr / local / script / log_record_script

Then save. Next time he logs into your system, script commands will automatically run, and the log records into the / usr / local / script / logrecordscript.

-q option allows scirpt command runs in silent mode, logged in users will not know the script command has been run. The -a option will allow records appended to the file, without erasing the previous record.

If you do not use the -q option, then when the user logs in, he will be notified like the figure below.

Exit Record

To exit record activity, we can press Ctrl + D in the terminal, or enter exit. Before exiting the script, you'll find the recording file size is 0 Kb, and after exiting, the file size will change.


Script commands you need to record or archive terminal activity may be useful when recording files are stored as a text file, so it can be easily opened with a text editor. As usual, we can enter man script or scirpt -h to display a help page and see more detailed usage.
- The execution order of Oracle WHERE condition is not from right to left (Database)
- MongoDB start under Linux (Database)
- Linux character device - user mode and kernel mode data transfer data (Linux)
- How to use Git to upload code to GitHub project (Linux)
- Wine 1.7 is installed on a system based on RedHat or Debian (Linux)
- Ubuntu 14.04 Fixed update information is outdated error (Linux)
- Android Activity launchMode (Programming)
- How to use awk command in Linux (Linux)
- RHEL 6.5 x86_64 CentOS yum configuration source (Linux)
- SecureCRT connect virtual machine Linux system (Ubuntu) (Linux)
- Android Fragment really fully resolve (Programming)
- Nine trick to let you speed up the old machine running Ubuntu Linux (Linux)
- Embedded Linux Optimization (Programming)
- APT-mirror using a four-step configuration Ubuntu local depot (Linux)
- Iptables on the request URL for IP access control (Linux)
- Several SQL Server data migration / Export Import Practice (Database)
- Nginx introduced Dynamic Module Architecture (Server)
- Java, hashcode, equals and == (Programming)
- CentOS How quickly customize kernel binary RPM package (Linux)
- Oracle 12C RAC on temporary table space Enlighten (Database)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.