TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sl: a mirror version of ls

165 pointsby fredrbabout 7 years ago

24 comments

_Marak_about 7 years ago
Probably an unpopular opinion, but I find aliases and extensive dotfiles counterproductive.<p>It&#x27;s better to learn and remember the exact commands. If you find yourself typing the same long command over and over again, the task should probably be automated or scripted as part of a separate pipeline.<p>Assuming you are successful with aliasing and don&#x27;t accidentally do something unexpected and catastrophic to your system, the moment you login to another system you will be lost and unable to remember any of the original and core commands.
评论 #16717676 未加载
评论 #16718499 未加载
评论 #16718010 未加载
评论 #16719200 未加载
评论 #16720088 未加载
评论 #16719079 未加载
评论 #16718296 未加载
评论 #16720506 未加载
评论 #16719178 未加载
评论 #16719632 未加载
评论 #16721854 未加载
pubbyabout 7 years ago
I always liked the story about the guy who aliased emacs to be &#x27;em&#x27;. Until one day he accidentally typed an &#x27;r&#x27; instead of an &#x27;e&#x27;. It turns out aliases can cost a lot more time than they can save!
评论 #16717468 未加载
评论 #16719360 未加载
p3llin0r3about 7 years ago
I like to add &quot;install <a href="https:&#x2F;&#x2F;github.com&#x2F;mtoyoda&#x2F;sl&quot;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mtoyoda&#x2F;sl&quot;</a> to my companies &quot;Getting started&quot; documentation to prank new hires. Great fun!
评论 #16718789 未加载
评论 #16716584 未加载
评论 #16718034 未加载
pantalaimonabout 7 years ago
Or you just<p><pre><code> alias sl=ls </code></pre> and have productivity reach unseen levels!
评论 #16716387 未加载
评论 #16716373 未加载
评论 #16716451 未加载
评论 #16716446 未加载
评论 #16716893 未加载
评论 #16717358 未加载
评论 #16716559 未加载
评论 #16718085 未加载
iamdaveabout 7 years ago
I once installed sl on a server. Completely forgot I put it there. It laid there dormant for MONTHS without anyone tripping over it. Then....it happened.<p>&quot;What the...why is my screen blac--is that a train-AW DAMMIT&quot;.<p>That person was me. The guy who installed the damn thing.<p>The progression from confusion, to curiosity, to realization that I had in fact...just played myself was kind of amusing in the moment.
pronoiacabout 7 years ago
See also, gti: <a href="http:&#x2F;&#x2F;r-wos.org&#x2F;hacks&#x2F;gti" rel="nofollow">http:&#x2F;&#x2F;r-wos.org&#x2F;hacks&#x2F;gti</a>
评论 #16717139 未加载
mverwijsabout 7 years ago
No no no. There is only one &#x27;sl&#x27;.<p><a href="https:&#x2F;&#x2F;asciinema.org&#x2F;a&#x2F;172723" rel="nofollow">https:&#x2F;&#x2F;asciinema.org&#x2F;a&#x2F;172723</a>
评论 #16716621 未加载
WalterGRabout 7 years ago
Interesting.<p>Faced with the choice of <i>punishing</i> myself for making a mistake vs. <i>adapting my environment</i> to accommodate me, I&#x27;ll always choose the latter.<p>(Plus, since you use `ls` so frequently, just make `l` an alias of it, especially if you have difficulty typing &quot;ls&quot;! Using a computer doesn&#x27;t have to be some weird, punishing, bondage and discipline experience.)
评论 #16716534 未加载
评论 #16716732 未加载
stazabout 7 years ago
Not to be confounded with the other project of the same name (and with the same purpose) <a href="https:&#x2F;&#x2F;github.com&#x2F;mtoyoda&#x2F;sl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mtoyoda&#x2F;sl</a>
评论 #16716493 未加载
combatentropyabout 7 years ago
a beautiful web page, and its only CSS is this:<p><pre><code> body { max-width: 50em; margin: auto; padding: 1em; line-height: 1.5em; } pre { overflow-x: auto; }</code></pre>
评论 #16720496 未加载
评论 #16718991 未加载
tomxorabout 7 years ago
Maybe i&#x27;m just weird but I can&#x27;t recall ever making this typo, I find myself making letter-swap typos of words&#x2F;commands with letters on the same hand often enough but that&#x27;s not quite so easy with ls.
评论 #16718546 未加载
评论 #16719280 未加载
gue5tabout 7 years ago
This code is incorrect: it has a a race condition that can cause it to use the wrong maximum width in its listing.
评论 #16716965 未加载
afranchukabout 7 years ago
I don&#x27;t want to sound high and mighty or anything, but I&#x27;ve never mistyped &#x27;ls&#x27;. I occasionally mistype other short binaries&#x2F;commands, but typically anything more than ~4 characters has me hitting tab, and that usually completes uniquely and (obviously) correctly.
评论 #16717333 未加载
评论 #16716830 未加载
oblioabout 7 years ago
This should go the whole hog: <a href="https:&#x2F;&#x2F;ubuntuforums.org&#x2F;archive&#x2F;index.php&#x2F;t-2078323.html" rel="nofollow">https:&#x2F;&#x2F;ubuntuforums.org&#x2F;archive&#x2F;index.php&#x2F;t-2078323.html</a>
femto113about 7 years ago
For some reason I don&#x27;t get ls wrong (right handed so maybe I reliably hit the l first) but I&#x27;ve had the following in my .alias for years<p><pre><code> # some common typos alias grpe grep alias gpre grep alias mroe more alias mreo more alias rmeo more</code></pre>
richardkissabout 7 years ago
This didn&#x27;t work on Mac OS due to &quot;wc -L&quot; so I whipped up a python version.<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;richardkiss&#x2F;4fba0c6bd27eb39a9eb56074dd0f2ba4" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;richardkiss&#x2F;4fba0c6bd27eb39a9eb56074...</a>
amichalabout 7 years ago
Long ago there was a ms dos. program called “rude dos” that if installed would replace the all commands with versions that randomly and rarely would refuse to work with various rude messages. I always ran it before letting my little brother use my computer :).
thecatspawabout 7 years ago
&gt; Consider this code GPLv3 licensed.<p>is this actually valid? Does it mean the code _is_ GPLv3 licensed or not?
评论 #16717229 未加载
评论 #16716371 未加载
评论 #16716374 未加载
评论 #16716382 未加载
stochastic_monkabout 7 years ago
The `wc -L` call fails on my Mac, but if I substitute gwc (as I have GNU coreutils available with a &quot;g&quot; prefix), it works.
richardkissabout 7 years ago
This didn&#x27;t work on Mac OS due to &quot;wc -L&quot; so I whipped up a python version.
gjvcabout 7 years ago
not quite there but<p>alias sl=&#x27;&#x2F;bin&#x2F;ls -l | tac | rev | column -t&#x27;
评论 #16719415 未加载
dexenabout 7 years ago
In similar vein: express your inner rage while terminating offending processes.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;robotlolita&#x2F;fuck-you" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;robotlolita&#x2F;fuck-you</a>
评论 #16719084 未加载
sullyj3about 7 years ago
I always alias &quot;ls&quot; to &quot;l&quot;
girstabout 7 years ago
Hi, author here. Feel free to ask questions!