我在终端上做了很多工作,所以我学到了很多关于我选择的 shell,zsh。您使用 zsh 的哪些功能来提高自己的工作效率?我的最爱之一是多目录自动完成。因此,cd /fo{tab}/ba{tab}/ba{tab}我可以不用打字,而是可以cd /fo/ba/ba{tab}保存那么多的击键!
我最近安装了 Samba,但我弄乱了/etc/samba/smb.conf文件。如何恢复原始配置?
有时我需要重新启动我的 linode,其中包括在 tmux 中运行的 IRC 客户端 weechat。当我这样做时,我更喜欢保存所有正在运行的缓冲区并重新加入它们。我的印象是:
/layout save
/save
Run Code Online (Sandbox Code Playgroud)
将存储适当的信息和
/layout apply
Run Code Online (Sandbox Code Playgroud)
会......很好地应用它。不幸的是,虽然它正确放置了新频道,但它并没有以任何方式重新加入我之前连接的频道。我知道我可以为每个网络手动添加要自动加入的频道列表,但是如果每次我需要关闭并重新打开 weechat 时都必须执行那个乏味的过程......那至少会是一个拖累。
有任何想法吗?我确定我以前做过这件事。
我经常暂停我的笔记本电脑 (pm-suspend),有时我的台式机 (pm-suspend-hybrid) 相当频繁。我正在使用最新的 ubuntu(13.10,俏皮)。
有没有办法可以在进入挂起状态时或在退出挂起状态后立即运行命令?我想终止任何打开的输出 ssh 连接并停止 offlineimap,因为这些超时往往很烦人。想法?
我的~/.ssh/config. 这是顶部的内容:
Host *
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 24h
BatchMode yes
Ciphers blowfish-cbc
Compression yes
VisualHostKey yes
Run Code Online (Sandbox Code Playgroud)
我想让它等ControlMaster不适用于 github;他们显然主动断开了这些持久连接,我理解并尊重它们。
所以要明确:
$ rm /tmp/ssh_mux_*
$ ssh git@github.com
PTY allocation request failed
Hi frioux! You've successfully authenticated, but GitHub does not provide shell access.
Shared connection to github.com closed.
$ ls /tmp/ssh_mux_*
/tmp/ssh_mux_github.com_22_git
Run Code Online (Sandbox Code Playgroud)
所以我阅读了一些文档,我在 IRC 中询问,这就是我最终得到的结果:
Host !github.com
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 24h
Host *
BatchMode yes
Ciphers blowfish-cbc
Compression yes
VisualHostKey yes
Run Code Online (Sandbox Code Playgroud)
所以现在github正确地不使用ControlMaster:
$ rm …Run Code Online (Sandbox Code Playgroud) ubuntu ×2
command-line ×1
config-files ×1
debian ×1
hibernate ×1
linux ×1
samba ×1
shell ×1
ssh ×1
suspend ×1
text-editing ×1
vi ×1
vim ×1
weechat ×1
zsh ×1