比如:
pwd | pbcopy
mac下是拷贝当前路径到黏贴板
最好写上注释, 对于没有注释的新手们不要乱试啊,乖,出问题了踩答案啊,为毛踩我的问题,看我开的头多好的,没想到楼歪这么厉害.....真是的, 看来TDD还没死,同志们请用你们的大脑编译器跑一下下面这个测试,跑挂了的请自觉修过测试:
def 狂霸酷炫 = (yourCommands) => {
yourCommands.forEach((command) => {
assert(command().userReaction).not.contains("草")
assert(command().userReaction).contains("Woww")
})
}
Ref: stackoverflow
ringa_lee2017-04-17 11:49:43
真的是狂欢呀。 If there is any tool worth recommending, I think the multiplexer tmux is worth owning
黄舟2017-04-17 11:49:43
cp target{,.bak} # 将target备份成target.bak
^old^new # 将上一条命令中第一个old字符串替换成new后重新执行
Ctrl - l # 清屏
Ctrl - r # 搜索历史命令
高洛峰2017-04-17 11:49:43
Some additions to @lidashuang’s answer on the 1st floor,
!! 表示上一次命令
!$ 表示上一次命令的最后一个参数
For example, if you use vi to open nginx, the default configuration is mistakenly written as cd:
cd /etc/nginx/sites-enabled/default
Change to vi <改>
vi !$
阿神2017-04-17 11:49:43
Don’t try it! ! ! ! ! ! ! !
Please see here:
The tragedy caused by a space
For example:
rm -rf /tmp/lib/nvidia-current/xorg/xorg
There is also a coder’s pseudo code on how to express loneliness on Valentine’s Day:
while !stackOverflow
push()
pop()
end
怪我咯2017-04-17 11:49:43
Add one more: ctrl-x e
Rapidly invoke an editor to write a long, complex, or tricky command
From: http://www.commandlinefu.com/