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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Sl: a mirror version of ls

165 点作者 fredrb大约 7 年前

24 条评论

_Marak_大约 7 年前
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 未加载
pubby大约 7 年前
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 未加载
p3llin0r3大约 7 年前
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 未加载
pantalaimon大约 7 年前
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 未加载
iamdave大约 7 年前
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.
pronoiac大约 7 年前
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 未加载
mverwijs大约 7 年前
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 未加载
WalterGR大约 7 年前
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 未加载
staz大约 7 年前
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 未加载
combatentropy大约 7 年前
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 未加载
tomxor大约 7 年前
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 未加载
gue5t大约 7 年前
This code is incorrect: it has a a race condition that can cause it to use the wrong maximum width in its listing.
评论 #16716965 未加载
afranchuk大约 7 年前
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 未加载
oblio大约 7 年前
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>
femto113大约 7 年前
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>
richardkiss大约 7 年前
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>
amichal大约 7 年前
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 :).
thecatspaw大约 7 年前
&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_monk大约 7 年前
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.
richardkiss大约 7 年前
This didn&#x27;t work on Mac OS due to &quot;wc -L&quot; so I whipped up a python version.
gjvc大约 7 年前
not quite there but<p>alias sl=&#x27;&#x2F;bin&#x2F;ls -l | tac | rev | column -t&#x27;
评论 #16719415 未加载
dexen大约 7 年前
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 未加载
sullyj3大约 7 年前
I always alias &quot;ls&quot; to &quot;l&quot;
girst大约 7 年前
Hi, author here. Feel free to ask questions!