Xshell Putty Terminal, how to record terminal input and output

Source: Internet
Author: User
Tags bz2 syslog

How to record terminal output?

Try using the script command-line tool to create an output record for your terminal output.

    1. script caimz.terminal.session #Caimz.terminal.session is a random name, I am conducive to recognize the name I can recognize

[Email protected] ~]# script caimz.terminal.session#开启
Script started, file is Caimz.terminal.session
[[email protected] ~]# ls
1 1.txt anaconda-ks.cfg caimz.terminal.session install.log install.log.syslog ks.cfg nohup.out
[Email protected] ~]# cd/usr/local/src/
[email protected] src]# LL
Total 752480
Drwxr-xr-x root root 4096 Dec 07:36 cmake-2.8.7
-rw-r--r--1 root root 5667409 Dec 06:51 cmake-2.8.7.tar.gz
-rw-r--r--1 root root 4704761 Oct 9 22:39 discuz_7.2_full_sc_utf8.zip
Drwxr-xr-x 4096 Dec 18:27 httpd-2.2.31
-rw-r--r--1 root root 7583841 Jul 10:12 httpd-2.2.31.tar.gz
-rw-r--r--1 root root 129074609 Nov 4 mysql-5.1.73-linux-i686-glibc23.tar.gz
-rw-r--r--1 root root 584116380 Nov 11:50 mysql-5.7.10-linux-glibc2.5-i686.tar.gz
Drwxr-xr-x 4096 Dec 18:54 php-5.6.13
-rw-r--r--1 root root 14077633 Sep 3 08:40 php-5.6.13.tar.bz2
-rw-r--r--1 root root 10039255 Dec 06:23 phpmyadmin-4.4.13.1-all-languages.zip
-rw-r--r--1 root root 7763122 Nov 04:56 phpmyadmin-4.5.2-all-languages.tar.bz2
Drwxr-xr-x 2 root root 4096 Dec 07:51 tarbag
-rw-r--r--1 root root 7475647 Dec 01:42 wordpress-4.4-zh_cn.tar.gz
[Email protected] src]# cd/data/
[[email protected] data]# ls
Blog MySQL phpMyAdmin www
[Email protected] data]# CD blog/
[[email protected] blog]# ls
index.php wordpress-4.4-zh_cn.tar.gz wp-comments-post.php wp-cron.php wp-login.php wp-trackback.php
License.txt wp-activate.php wp-config.php wp-includes wp-mail.php xmlrpc.php
Readme.html wp-admin wp-config-sample.php wp-links-opml.php wp-settings.php
WordPress wp-blog-header.php wp-content wp-load.php wp-signup.php
[Email protected] blog]# CD. /.. /
[[email protected]/]# s
Bash:s: Command not found
[[email protected]/]# ls
Bin Centosinstall Dev Home lost+found mnt proc root selinux sys tmp var
Boot data etc Lib media opt pxeftp sbin srv tftpboot usr

To exit (end the script session), enter exit or logout or press control-d.

    1. exit

[[Email protected]/]# exit
Exit
Script done, file is Caimz.terminal.session

[email protected] ~]# LL
Total 80
-rw-r--r--1 root root 1807 Dec 13 01:56 1
-rw-r--r--1 root root 07:31 1.txt
-RW-------. 1 root root 2676 Dec 03:11 anaconda-ks.cfg
-rw-r--r--1 root root 2868 Dec 18:03 caimz.terminal.session #这个就是刚才我记录那个文档
-rw-r--r--. 1 root root 39935 Dec 03:11 Install.log
-rw-r--r--. 1 root root 9154 Dec 03:10 install.log.syslog
-rw-r--r--1 root root 1032 Dec 02:23 ks.cfg
-RW-------1 root root 883 Dec 01:49 nohup.out

To browse for input:

    1. more   caimz . terminal.session

    2. less  caimz . terminal.session

    3. cat  caimz . terminal.session

To see the previous action.


Xshell Putty Terminal, how to record terminal input and output

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.