xshell 录制服务器操作步骤日志

背景

在很多时候,譬如写博客教程的时候,需要记录服务器操作步骤的命令和结果。大多数情况下要边执行命令边复制或者截图记录到文档,这样的效率并不高而且会终端思路引起错误操作等。

录制日志设置

xshell 文件-属性(快捷键Alt+P)

文件-属性

属性-日志记录

日志选项

切记不要勾选 包括终端代码,否则可能会出现乱码等情况:
[BEGIN] 2020/2/17 12:42:54

Last login: Mon Feb 17 04:04:15 2020 from 10.0.2.2

[vagrant@homestead: ~[vagrant@homestead:~]$ pwd
/home/vagrant
[vagrant@homestead: ~[vagrant@homestead:~]$ ll
total 120
drwxr-xr-x 12 vagrant vagrant  4096 Dec 29 09:46 ./
drwxr-xr-x  3 root    root     4096 Jun  3  2018 ../
-rw-r--r--  1 root    root     6920 Dec 20 06:36 .bash_aliases
-rw-------  1 vagrant vagrant 11046 Feb 17 04:04 .bash_history
-rw-r--r--  1 vagrant vagrant   220 Jun  3  2018 .bash_logout
-rw-r--r--  1 vagrant vagrant  3773 Jul 26  2018 .bashrc
drwx------  4 vagrant vagrant  4096 Jun  3  2018 .cache/
drwxrwxr-x  4 vagrant vagrant  4096 Nov 27 08:12 .composer/
-rw-rw-r--  1 vagrant vagrant     4 Jul 25  2018 composer.json
drwxr-xr-x  4 vagrant vagrant  4096 Jun  3  2018 .config/
drwx------  3 vagrant vagrant  4096 Jun  3  2018 .gnupg/
drwxr-xr-x  3 vagrant vagrant  4096 Jun  3  2018 .local/
-rw-r--r--  1 root    root       61 Dec 20 06:37 .my.cnf
-rw-------  1 vagrant vagrant   322 Jul 18  2018 .mysql_history
drwxrwxr-x  2 vagrant vagrant  4096 Jun 12  2018 .ngrok2/
drwxr-xr-x  6 vagrant vagrant  4096 Dec 13 07:36 .npm/
drwxr-xr-x 11 vagrant vagrant  4096 Jun  3  2018 .oh-my-zsh/
-rw-r--r--  1 vagrant vagrant   888 Dec 20 06:36 .profile
-rw-------  1 vagrant vagrant   554 Jan 15 07:26 .rediscli_history
drwxr-xr-x  2 vagrant vagrant  4096 Oct 16 07:22 .rpmdb/
drwx------  2 vagrant vagrant  4096 Jun 12  2018 .ssh/
-rw-r--r--  1 vagrant vagrant     0 Jun  3  2018 .sudo_as_admin_successful
-rw-r--r--  1 vagrant vagrant     5 Jun  3  2018 .vbox_version
-rw-------  1 vagrant vagrant 10360 Dec 25 03:44 .viminfo
-rw-r--r--  1 vagrant vagrant   298 Jun 12  2018 .wget-hsts
-rw-r--r--  1 vagrant vagrant  3169 Jun  3  2018 .zshrc
[vagrant@homestead: ~[vagrant@homestead:~]$ exit
logout

Connection closed by foreign host.

Disconnected from remote host(vagrant) at 12:43:10.

Type `help' to learn how to use Xshell prompt.

[c:\~]$ 
[END] 2020/2/17 12:43:16

属性-终端

设置编码

录制日志

开始录制日志

得到日志文件

以下为正常日志

[BEGIN] 2020/2/17 12:45:15

Last login: Mon Feb 17 04:44:59 2020 from 10.0.2.2
[vagrant@homestead:~]$ ll
total 120
drwxr-xr-x 12 vagrant vagrant  4096 Dec 29 09:46 ./
drwxr-xr-x  3 root    root     4096 Jun  3  2018 ../
-rw-r--r--  1 root    root     6920 Dec 20 06:36 .bash_aliases
-rw-------  1 vagrant vagrant 11068 Feb 17 04:43 .bash_history
-rw-r--r--  1 vagrant vagrant   220 Jun  3  2018 .bash_logout
-rw-r--r--  1 vagrant vagrant  3773 Jul 26  2018 .bashrc
drwx------  4 vagrant vagrant  4096 Jun  3  2018 .cache/
drwxrwxr-x  4 vagrant vagrant  4096 Nov 27 08:12 .composer/
-rw-rw-r--  1 vagrant vagrant     4 Jul 25  2018 composer.json
drwxr-xr-x  4 vagrant vagrant  4096 Jun  3  2018 .config/
drwx------  3 vagrant vagrant  4096 Jun  3  2018 .gnupg/
drwxr-xr-x  3 vagrant vagrant  4096 Jun  3  2018 .local/
-rw-r--r--  1 root    root       61 Dec 20 06:37 .my.cnf
-rw-------  1 vagrant vagrant   322 Jul 18  2018 .mysql_history
drwxrwxr-x  2 vagrant vagrant  4096 Jun 12  2018 .ngrok2/
drwxr-xr-x  6 vagrant vagrant  4096 Dec 13 07:36 .npm/
drwxr-xr-x 11 vagrant vagrant  4096 Jun  3  2018 .oh-my-zsh/
-rw-r--r--  1 vagrant vagrant   888 Dec 20 06:36 .profile
-rw-------  1 vagrant vagrant   554 Jan 15 07:26 .rediscli_history
drwxr-xr-x  2 vagrant vagrant  4096 Oct 16 07:22 .rpmdb/
drwx------  2 vagrant vagrant  4096 Jun 12  2018 .ssh/
-rw-r--r--  1 vagrant vagrant     0 Jun  3  2018 .sudo_as_admin_successful
-rw-r--r--  1 vagrant vagrant     5 Jun  3  2018 .vbox_version
-rw-------  1 vagrant vagrant 10360 Dec 25 03:44 .viminfo
-rw-r--r--  1 vagrant vagrant   298 Jun 12  2018 .wget-hsts
-rw-r--r--  1 vagrant vagrant  3169 Jun  3  2018 .zshrc
[vagrant@homestead:~]$ pwd
/home/vagrant
[vagrant@homestead:~]$ exit
logout

Connection closed by foreign host.

Disconnected from remote host(vagrant) at 12:45:27.

Type `help' to learn how to use Xshell prompt.

[END] 2020/2/17 12:45:32
Responses
  1. I pay a quick visit everyday some web pages and websites to read articles or reviews, except this web site provides feature based content. asmr 0mniartist

    Reply
  2. When someone writes an article he/she keeps the idea of a user in his/her brain that how a user can be aware of it. So that's why this piece of writing is great. Thanks! asmr 0mniartist

    Reply
  3. Right away I am going away to do my breakfast, afterward having my breakfast coming over again to read further news. 0mniartist asmr

    Reply
  4. Hey! This is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a marvellous job! asmr 0mniartist

    Reply
  5. It's genuinely very difficult in this full of activity life to listen news on Television, therefore I simply use internet for that reason, and take the most up-to-date news. asmr 0mniartist

    Reply
  6. Dix

    You require a thesis statement on your faculty essays. ... Your composition needs to alternatively be described as a window in your planet. Your composing mode in faculty essays things a fantastic thing. Don commence any other sentence with"nevertheless." https://www.haraldkongshaug.com/2021/03/26/what-time-do-stanford-decisions-come-out/ http://wallenstamracing.com/should-you-put-headings-in-an-essay/ https://sreejitafilms.in/how-do-you-cite-a-powerpoint-in-mla/

    Reply