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. Bedava Free Fire Hesap 2021 | Garena Hesap ve Şifre, Bu içerikte sizlere bedava ateş oyunu ve bedava hesaplar hakkında bilgi vereceğiz. Serbest atış çok güzel bir oyun olduğu kadar popüler bir oyun. Çoğu insan serbest atış oynarken heyecanlanır ve daha fazla hata yapar. Onlardan biri olmayın ve heyecanlanmadan güzelce oynamaya çalışın. Neden? Çünkü bedava ateş turnuvalarında para veya değerli hediyeler kazanabilirsiniz. Gerçekten değerli bir şey kazanmak istiyorsanız, önce turnuvaya katılmalı ve kazanmalısınız. Bunun için sıkı bir antrenman yapmalısınız. Bedava Free Fire Hesap

    Reply
  2. Hi! Would you mind if I share your blog with my zynga group? There's a lot of folks that I think would really enjoy your content. Please let me know. Thank you

    Reply
  3. When someone writes an article he/she retains the image of a user in his/her brain that how a user can be aware of it. So that's why this post is amazing. Thanks!

    Reply
  4. fantastic submit, very informative. I wonder why the opposite experts of this sector do not understand this. You must proceed your writing. I'm confident, you've a great readers' base already!

    Reply
  5. Excellent post. I'm facing many of these issues as well..

    Reply
  6. Ücretsiz bir hesap paylaşım sitesi; internet sayfaları, uygulamalar, çevrimiçi uygulamalar ve diğer birçok alan. Bedava bir hesap paylaşım sitesi; internet sayfaları, uygulamalar, çevrimiçi uygulamalar ve diğer birçok alan. bedava hesap

    Reply