xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Linux copy from pipe command All In One

Linux copy from pipe command All In One

shutdown

# Linux 关机
$ shutdown --help

$ man shutdown

Raspberry Pi

# Raspberry Pi ???
$ man shutdown | ???

macOS

# macOS ✅
$ man shutdown

$ man shutdown | pbcopy

手动复制粘贴

  1. 不优雅,效率太低了 💩
  2. 如果 man 手册存在分页, 需要一页一页的手动复制粘贴 💩
  3. 复制的格式,可能会错乱掉 ❌
    ...
$ touch shutdown.md

# 鼠标滑动全选文本,手动复制粘贴到 shutdown.md ✅
$ man shutdown

image

自动导出 ❌

$ man shutdown | pbcopy > shutdown.md

# vscode 中显示乱码 bug ❌
$ man shutdown > shutdown.md

image

# vscode 中显示乱码 ❌ ,但是 terminal 中查看却显示正常 ✅
$ cat shutdown.md

# <  这个是什么操作符号❓
$ cat < shutdown.md

image

https://stackoverflow.com/questions/74505387/is-this-a-pbcopy-command-garbled-bug

ASCII backspace characters bug ❌

ASCII backspace characters

ASCII 退格字符

Backspace key

https://www.computerhope.com/jargon/b/backspac.htm

solution

use vscode to fix copy from terminal encoding bug 🚀

修复 macOSterminal 导出 man 手册到 markdown 文件的时候,vscode 中显示出现的乱码 bug 🚀

vscode 全部选中 " 符号,连续两次删除后,保存即可!✅

image

demos

# SSH
$ ssh pi@raspberrypi.local

# 等待⌛️一分钟后,不取消就立刻关机 ✅
$ sudo shutdown -H

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

Linux pbcopy command garbled bug All In One

pbcopy 命令乱码 bug ❌

https://www.cnblogs.com/xgqfrms/p/16907953.html

pbcopy bug garbled / 乱码

https://www.cnblogs.com/xgqfrms/p/16879389.html

Linux grep command All In One

https://www.cnblogs.com/xgqfrms/p/16900167.html

refs

https://askubuntu.com/questions/1428335/how-can-i-copy-from-a-pipe-file



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-04-13 23:17  xgqfrms  阅读(21)  评论(2编辑  收藏  举报