TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

SL(1): Cure your bad habit of mistyping

107 点作者 lukestateson将近 3 年前

25 条评论

sseagull将近 3 年前
After you think you are perfect, then there’s suicide linux: <a href="https:&#x2F;&#x2F;github.com&#x2F;tiagoad&#x2F;suicide-linux" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tiagoad&#x2F;suicide-linux</a><p>“Any time - any time - you type any remotely incorrect command, the interpreter creatively resolves it into rm -rf &#x2F; and wipes your hard drive.”
评论 #32078439 未加载
评论 #32077508 未加载
评论 #32077229 未加载
storyinmemo将近 3 年前
Embrace your habit of mistyping: <a href="https:&#x2F;&#x2F;github.com&#x2F;nvbn&#x2F;thefuck#readme" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nvbn&#x2F;thefuck#readme</a>
评论 #32078399 未加载
agentwiggles将近 3 年前
I have this in my `.zshrc` on my personal machine. I get a kick out of it:<p>```<p>function command_not_found_handler() { figlet &quot;lol, $1&quot; }<p>```<p>(I think the bash equivalent is `command_not_found_handle`).<p>This overrides the function that usually prints the `zsh: command not found: foo` message, and instead, mocks you, by printing &quot;lol, foo&quot; (but in big ol&#x27; figlet letters).<p>SL is in a similar, but admittedly much more elaborate, spirit.
评论 #32080644 未加载
gorgoiler将近 3 年前
<i>SL(1): Learn the muscle-memory to send SIGQUIT all the time</i><p>Part of this tool’s “charm” is that it traps SIGINT so you truly are forced to watch the animation as a punishment for bad typing, even if you try to send it SIGINT from your keyboard by typing control-C.<p>Control-backslash sends SIGQUIT on the other hand. This signal cannot be trapped.<p>Perhaps sl could launch a parent process and a child process, put the child in a different process group, then restart the child if the parent sees it do a core dump?<p>Or launch two children — one of them daemonized — where the daemon attaches a new sl to your terminal if it sees its sibling one die prematurely. You could still get back to an interactive shell with the right signal but sl would keep annoying you by drawing a train over the top.
评论 #32079294 未加载
rzzzt将近 3 年前
No cure, it just conditioned me into expecting to see the little train go by occasionally.
arthurdenture将近 3 年前
Extremely useful .gitconfig snippet:<p><pre><code> [alias] git = !sl </code></pre> catches e.g. `git git status`, which I run shockingly often.
hbagdi将近 3 年前
Used this years ago. It is funny the first few times and then not. Cures nothing but frustrates the hell out, especially when you are in a hurry (and that&#x27;s when you make the most typos).
jwilk将近 3 年前
There&#x27;s also gti:<p><a href="https:&#x2F;&#x2F;r-wos.org&#x2F;hacks&#x2F;gti" rel="nofollow">https:&#x2F;&#x2F;r-wos.org&#x2F;hacks&#x2F;gti</a>
gnicholas将近 3 年前
I so often type &quot;nevermind&quot; instead of &quot;never mind&quot; that I created a shortcut on my computer that replaces the former with the latter. I have met many other people of my generation (early 40s) who also thought it was a single word. I think we were influenced by the popular Nirvana album, which used the single-word spelling.
评论 #32078570 未加载
评论 #32077903 未加载
评论 #32077969 未加载
评论 #32078033 未加载
femto113将近 3 年前
Or embrace it... I don&#x27;t seem to mistype ls often enough to care, but my ~&#x2F;.alias has a few things of this sort<p><pre><code> # some common typos alias grpe grep alias gpre grep alias mroe more alias mreo more alias rmeo more</code></pre>
评论 #32079409 未加载
评论 #32079683 未加载
评论 #32080089 未加载
pantalaimon将近 3 年前
<p><pre><code> alias sl=ls </code></pre> Watch productivity skyrocket
评论 #32078547 未加载
评论 #32078557 未加载
评论 #32080182 未加载
roughly将近 3 年前
At a previous job, someone (with the permission to do so) installed this on a shared server, which led to one of the more ridiculous security incident tickets I saw there.
lf-non将近 3 年前
My first job was at a company where this was installed system wide on all remote linux boxes. Everytime you type sl it would take over the whole terminal for a couple of seconds leaving you unable to do anything. This was before docker &amp; devops era so we used to ssh into machines at lot.<p>It was the thing that prompted me to learn tmux so I could switch tabs without needing multiple putty windows.<p>The original use case went away long back, but I use tmux still, so thanks I guess :)
deergomoo将近 3 年前
I regularly mistype “myself” as “mysql” and vice versa. It’s like my brain registers the “mys”, figures my fingers have it covered, and checks out.
评论 #32080849 未加载
sundarurfriend将近 3 年前
I was surprised when I first came across this, to know that this was apparently such a common typo - since I don&#x27;t ever recall doing this particular typo myself, even though I&#x27;m prone to character-transposition typos.<p>But then I realized, I rarely ever do `ls` itself - it&#x27;s always either `ll` = alias for `ls -lh` or `la` = alias for `ll -A`. And those seem less typo prone, somehow.
everyone将近 3 年前
I have no idea how I am able to type words on a computer keyboard. Its just something I somehow picked up with practice.
systems_glitch将近 3 年前
Had this in every Chef recipe at $previous_job. Probably still there, 7 years later.
评论 #32077196 未加载
com2kid将近 3 年前
I added an alias &#x27;ll&#x27;.<p><pre><code> alias ll=&#x27;ls -Glopa&#x27; </code></pre> and while I was at it<p><pre><code> alias cls=&#x27;clear &amp;&amp; printf \\e[3J&#x27; </code></pre> Yes, I grew up using MS DOS, why do you ask?
评论 #32080200 未加载
评论 #32080791 未加载
user3939382将近 3 年前
For many years it’s one of the first things I install just because I enjoy the whimsy. I’ve never reversed ls by accident though, I didn’t even realize it was a play on ls.
urxvtcd将近 3 年前
I have a script called wq in my path, that echoes &quot;haha!&quot;, when I type ;wq in my shell. That is because I have swapped colon and semicolon in my vimrc.
suprjami将近 3 年前
`alias ls=sl` on your friend&#x27;s unlocked computer
评论 #32076606 未加载
评论 #32077975 未加载
hs86将近 3 年前
Run `sl | lolcat` for maximum productivity.
dmurray将近 3 年前
Has anyone rewritten this in Rust yet?
remram将近 3 年前
Unfortunately I enter &#x27;dc&#x27; far more often than &#x27;sl&#x27;.
Pr0ject217将近 3 年前
Is typing &#x27;ls&#x27; correctly that common of a problem? =&#x2F;
评论 #32078244 未加载