7 ms·
SL(1): Cure your bad habit of mistyping
- hs86 4y agoRun `sl | lolcat` for maximum productivity.
- jwilk 4y agoThere's also gti: https://r-wos.org/hacks/gti https://r-wos.org/hacks/gti
- suprjami 4y ago`alias ls=sl` on your friend's unlocked computer
- corrral 4y agoJust install sl. They'll see it soon enough.
- hotpotamus 4y agoFound it in my .bashrc once. That was a good trick. Now any time a buddy and I share have a login on one another's machine, the ssh motd is an ASCII train that says "toot toot".
- storyinmemo 4y agoEmbrace your habit of mistyping: https://github.com/nvbn/thefuck#readme https://github.com/nvbn/thefuck#readme
- SAI_Peregrinus 4y agoI use that all the time as a shortcut to push new git branches without having to type the whole name.
- gary-kim 4y agoYou can enable tab complete for Git including for branch names. I don't know how I would live without that. I tend to make rather verbose branch names and typing it all out stuff like push would take forever. Though, you have a much more fun solution.
- kelnos 4y agoIn addition to tab complete for branch names, git has a `help.autoCorrect` config item that allows git to automatically correct typos in command names. I weirdly type "git poush" incredibly often, and it's nice for git to pretend I typed "push".
- RagingCactus 4y ago`git push -u origin HEAD` pushes the current branch to `origin` with the same name you have locally. You could even add an alias for that.
- mananaysiempre 4y agoOr set `push.default` to `current` to have plain `git push origin` push to the same remote name, ignoring the configured upstream (you might also want to set `remote.pushDefault` alongside that).
- sseagull 4y agoAfter you think you are perfect, then there’s suicide linux: https://github.com/tiagoad/suicide-linux https://github.com/tiagoad/suicide-linux “Any time - any time - you type any remotely incorrect command, the interpreter creatively resolves it into rm -rf / and wipes your hard drive.”
- deleted 4y ago[deleted]
- arthurcolle 4y agoThis could be neat for production environments in a kind of chaos monkey sense
- yarg 4y agoLeaves it a little difficult to tell which bed was shat.
- ulyssys 4y agoNot if you log all terminal input to the production log server.
- DiggyJohnson 4y agoThis is the new North Star for my system architecture. Another win for DevOps! Thank you.
- mootzville 4y agoUp the stakes and mount your home NAS
- systems_glitch 4y agoHad this in every Chef recipe at $previous_job. Probably still there, 7 years later.
- IncRnd 4y agoChefs themselves face this! Nobody wants a Chef who grabs the wrong ingredients for a recipe, accidentally rm-ing their customers.
- rzzzt 4y agoNo cure, it just conditioned me into expecting to see the little train go by occasionally.
- com2kid 4y agoI added an alias 'll'. alias ll='ls -Glopa' and while I was at it alias cls='clear && printf \\e[3J' Yes, I grew up using MS DOS, why do you ask?
- aargh_aargh 4y agohttps://explainshell.com/explain?cmd=ls+-Glopa https://explainshell.com/explain?cmd=ls+-Glopa
- teddyh 4y ago> alias ll='ls -Glopa' Does not the -o make both the -G and -l unnecessary?
- com2kid 4y agoDurp, you are correct. No idea how it ended up that way.
- arthurdenture 4y agoExtremely useful .gitconfig snippet: [alias] git = !sl catches e.g. `git git status`, which I run shockingly often.
- hbagdi 4y agoUsed 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's when you make the most typos).
- Pr0ject217 4y agoIs typing 'ls' correctly that common of a problem? =/
- bee_rider 4y agoIt is probably rare but, but if you spend most of your time on the command line it is sort of like tripping over nothing -- sticks in your memory. Particularly if it happens around other people.
- gnicholas 4y agoI so often type "nevermind" instead of "never mind" 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.
- zerocrates 4y agoClearly you needed to be born a little earlier so you could instead have been influenced by the proper diction of Never Mind the Bollocks, Here's the Sex Pistols.
- johncs 4y agoAh of course you meant in a word processor... $ never mind -bash: never: command not found Thought I was about to learn about a new utility for a moment.
- Kaze404 4y agoWelp, I also just learned it's not a single word.
- Beltalowda 4y agoIf enough people spell something "wrong" it automatically becomes the correct (or rather, standard) spelling, and words can have more than one correct spelling, too.
- gnicholas 4y agoTrue! I've checked the dictionary several times, and we've apparently not hit the tipping point yet.
- roughly 4y agoAt 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.
- agentwiggles 4y agoI have this in my `.zshrc` on my personal machine. I get a kick out of it: ``` function command_not_found_handler() { figlet "lol, $1" } ``` (I think the bash equivalent is `command_not_found_handle`). This overrides the function that usually prints the `zsh: command not found: foo` message, and instead, mocks you, by printing "lol, foo" (but in big ol' figlet letters). SL is in a similar, but admittedly much more elaborate, spirit.
- gliiics 4y agoI've been using prezto[0] for a long time so I'm not sure anymore if this is integrated in zsh, but at least using prezto I get this when I run a wrong command: > claer zsh: correct 'claer' to 'clear' [nyae]? n zsh: command not found: claer I am guilty of not reading the docs, but I learnt by experience that n/y/a/e stands for no (run without correction)/yes (correct)/abort (don't run)/edit (manually/interactively) [0] https://github.com/sorin-ionescu/prezto https://github.com/sorin-ionescu/prezto
- everyone 4y agoI have no idea how I am able to type words on a computer keyboard. Its just something I somehow picked up with practice.
- pantalaimon 4y agoalias sl=ls Watch productivity skyrocket
- Beltalowda 4y agoalias l=ls is even better! Can't reverse the order of letters if there's just one letter.
- omoikane 4y agoI do the same, and also: dc=cd, wpd=pwd, tiem=time.
- deleted 4y ago[deleted]
- gorgoiler 4y agoSL(1): Learn the muscle-memory to send SIGQUIT all the time 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. Control-backslash sends SIGQUIT on the other hand. This signal cannot be trapped. 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? 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.
- user3939382 4y agoFor 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.
- femto113 4y agoOr embrace it... I don't seem to mistype ls often enough to care, but my ~/.alias has a few things of this sort # some common typos alias grpe grep alias gpre grep alias mroe more alias mreo more alias rmeo more
- cpeterso 4y agoand: alias cd..="cd .." alias ..="cd .."
- skitter 4y agoFish and Zsh can automatically cd into a dir if you type a path in.
- jnsaff2 4y agothe times I've typed .. dicker or focker, ducker ... or the combination of the last two .. bleh
- lordgrenville 4y agozsh `setopt correct` is pretty helpful with these kinds of typos.
- dizhn 4y agoThis sounded interesting but too magicky to me and I did a google search. Most of the top results are about how to disable or limit it. :) I believe I experienced this kind of feature with fish and it was one of the reasons I didn't like it. (Most things cannot be user configured away in fish).
- lordgrenville 4y agoIt works fine for me. I do have `correct_all` unset, which makes it only apply to the command and not the arguments.
- sundarurfriend 4y agoI was surprised when I first came across this, to know that this was apparently such a common typo - since I don't ever recall doing this particular typo myself, even though I'm prone to character-transposition typos. But then I realized, I rarely ever do `ls` itself - it's always either `ll` = alias for `ls -lh` or `la` = alias for `ll -A`. And those seem less typo prone, somehow.
- urxvtcd 4y agoI have a script called wq in my path, that echoes "haha!", when I type ;wq in my shell. That is because I have swapped colon and semicolon in my vimrc.
- lf-non 4y agoMy 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 & devops era so we used to ssh into machines at lot. It was the thing that prompted me to learn tmux so I could switch tabs without needing multiple putty windows. The original use case went away long back, but I use tmux still, so thanks I guess :)
- dmurray 4y agoHas anyone rewritten this in Rust yet?
- deergomoo 4y agoI 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.
- unsafecast 4y agoI do this for share and shader. I should symlink /usr/share to /usr/shader at this point.
- remram 4y agoUnfortunately I enter 'dc' far more often than 'sl'.