Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux script commands - terminal recorder     - Linux environment has been running Tomcat how to deploy the new Tomcat (Server)

- CentOS 6.6 installation certification system based on the ftp service (Server)

- Linux using RAID how to use Mdadm Tool Management Software RAID (Linux)

- Shilpa Nair interview experience sharing RedHat Linux package management (Linux)

- RPM package management tools under Linux (Linux)

- Linux Basic Course: Install the software from source code (Linux)

- Iscsi package is installed on RHEL 6.3 x86-64 systems (Linux)

- Graphing tool: Gnuplot (Linux)

- Linux virtual machines to solve end MySQL database can not remote access (Database)

- The first deployment of cross-platform operation Rafy record (Server)

- PPA on Ubuntu Linux installation Plank 0.8.0 (Linux)

- Hadoop1.2.1 plug compilation (Server)

- The difference between vi and nano (Linux)

- The difference Docker save and export commands (Linux)

- To configure linux transparent firewall (Linux)

- Linux MultiPath software implementation instructions (Linux)

- VirtualBox 4.3 Can not open a new task for a virtual computer solution (Linux)

- Java NIO in the world (Programming)

- Linux shell in back quotes (`) Application (Linux)

- Zabbix system email alert Python script (Server)

 
         
  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.

end

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.
     
         
       
         
  More:      
 
- Through eight skills to let you become a super Linux end-user (Linux)
- C language files update in real time (Programming)
- MongoDB start under Linux (Database)
- Teach you how to choose to install CentOS 6.5 installation package (Linux)
- CentOS install SystemTap-2.6 (Linux)
- Ubuntu Apache virtual host configuration (Server)
- Linux systems for entry-learning - Install Go language in Linux (Linux)
- Ubuntu disable graphics card (Linux)
- On the design of Oracle database backup (Database)
- How to use nmap command in Linux (Linux)
- UNIX and class UNIX system security check notes (Linux)
- Use Markdown editor for document work under Linux (Linux)
- Linux module mechanism of (Programming)
- Protect against network attacks using Linux system firewall (Linux)
- CentOS 6.0 system security level (Linux)
- Python extension module Ganglia 3.1.x (Linux)
- STL in the list of erase () method (Programming)
- Give your photos Instagram style filters plus program in ubuntu (Linux)
- Zabbix monitors the status of TCP connections (Server)
- Detailed software to run UnixBench (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.