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

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-2025

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

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


posted @   xgqfrms  阅读(27)  评论(2编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
历史上的今天:
2022-04-13 CSS Parent Selector :has All In One
2022-04-13 TypeScript Decorator Metadata All In One
2022-04-13 斯特鲁维测地弧 All In One
2021-04-13 _.cloneDeep & JSON deep copy bug All In One
2021-04-13 React useEffect compare old new dependency
2021-04-13 webpack & css-in-js
2021-04-13 git config & color log All In One
点击右上角即可分享
微信分享提示