日常出bug求助的時候有時候貼代碼或者截圖每每不直觀,若是能重現給對方看就行了,這裏推薦 2 個命令行的錄製工具。html
網站https://asciinema.org/
,github主頁https://github.com/asciinema
直接使用 pip install asciinema
來安裝。
執行asciinema rec
開始錄製,錄製完成後 exit 退出,能夠保存到本地或者上傳到 https://asciinema.org
。python
[root@VM_0_14_centos ~]# asciinema rec asciinema: recording asciicast to /tmp/tmp1ua5a2rx-ascii.cast asciinema: press <ctrl-d> or type "exit" when you're done [root@VM_0_14_centos ~]# pwd /root [root@VM_0_14_centos ~]# cd /usr/share/nginx/html/ [root@VM_0_14_centos html]# pip install asciinema DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429). Looking in indexes: http://mirrors.tencentyun.com/pypi/simple Requirement already satisfied: asciinema in /usr/lib/python3.4/site-packages (2.0.2) You are using pip version 19.0.3, however version 19.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [root@VM_0_14_centos html]# pip list |grep ascii DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429). asciinema 2.0.2 You are using pip version 19.0.3, however version 19.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [root@VM_0_14_centos html]# exit exit asciinema: recording finished asciinema: press <enter> to upload to asciinema.org, <ctrl-c> to save locally View the recording at: https://asciinema.org/a/AdnqMX0QfOg5c7USOtwHZ4Hz1 This installation of asciinema recorder hasn't been linked to any asciinema.org account. All unclaimed recordings (from unknown installations like this one) are automatically archived 7 days after upload. If you want to preserve all recordings made on this machine, connect this installation with asciinema.org account by opening the following link: https://asciinema.org/connect/01fb0f0e-c56a-450f-80ac-4020188dd957
錄製過程在https://asciinema.org/a/AdnqM... 能夠看到了。nginx
若是分享給他人能夠用郵箱註冊,它不須要密碼就能夠註冊。我註冊後的主頁https://asciinema.org/~susheng
而後打開這個連接 https://asciinema.org/connect... 就會保存到你帳號下。git
設置爲public 後可生成公開連接,可分享給他人觀看,還能夠嵌入到本身的網站。github
視頻連接後加 .png 是視頻截圖 https://asciinema.org/a/25434... ,而連接後加 .js 就能夠直接嵌入網站了。centos
<a href="https://asciinema.org/a/254348" target="_blank"><img src="https://asciinema.org/a/254348.svg" /></a> <script src="https://asciinema.org/a/254348.js" id="asciicast-254348" async data-autoplay="true" data-size="big"></script>
TermRecord也是用 pip 安裝 pip install TermRecord
, 直接開始錄製 TermRecord -o termrecord.html
輸入 exit 結束錄製 。這個 termrecord.html 就是錄製生成的文件,能夠直接用瀏覽器打開。瀏覽器
[root@VM_0_14_centos html]# TermRecord -o termrecord.html Script started, file is /tmp/tmpdekpz_p2 [root@VM_0_14_centos html]# pwd /usr/share/nginx/html [root@VM_0_14_centos html]# whoami root [root@VM_0_14_centos html]# pip install TermRecord DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429). Looking in indexes: http://mirrors.tencentyun.com/pypi/simple Requirement already satisfied: TermRecord in /usr/lib/python3.4/site-packages (1.2.5) Requirement already satisfied: Jinja2>=2.6 in /usr/lib64/python3.4/site-packages (from TermRecord) (2.10.1) Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python3.4/site-packages (from Jinja2>=2.6->TermRecord) (1.1.1) You are using pip version 19.0.3, however version 19.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [root@VM_0_14_centos html]# pip list|grep Term DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429). TermRecord 1.2.5 You are using pip version 19.0.3, however version 19.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. [root@VM_0_14_centos html]# exit exit Script done, file is /tmp/tmpdekpz_p2
而後打開文件就能夠看到錄製過程了ruby
另外還有個基於ruby的showterm和termtosvg就不演示了 http://showterm.io/
https://github.com/nbedos/termtosvg微信
推薦閱讀:async