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.

Ask HN: Do you use the bash alias feature much?

5 pointsby LoveGracePeacealmost 3 years ago
I tend to forget aliases I've set up and mostly use Ctrl+R to reverse search history and find the command I want if I've used it before. Either that or "history | grep <command_used_before>" if it was some time in the past. Aliases just don't stick in my memory.

8 comments

eulers_secretalmost 3 years ago
I don&#x27;t, because I SSH into a lot of machines - many are systems I don&#x27;t own so can&#x27;t really change things on. Or they&#x27;ll be re-imaged in a day anyways.<p>I almost always prefer to use what&#x27;s available by default, that way what I memorize works anywhere.
dredmorbiusalmost 3 years ago
Somewhat less with time, as bash <i>functions</i> are preferred and more powerful handle arguments, multi-step processing, logic).<p>But yes, for basic arguments, particularly for ls:<p><pre><code> alias ls=&#x27;ls -F&#x27; alias la=&#x27;ls -A&#x27; alias ll=&#x27;ls -l&#x27; </code></pre> Occasionally for other commands for which the default is not ideal. w3m, for example, will read the bookmarks file if URL is passed, with &#x27;-B&#x27;, but otherwise exits with an error, which is annoying.<p><pre><code> alias w3m=&#x27;w3m -B&#x27; </code></pre> Git commands, as others note.
rurbanalmost 3 years ago
Yes. And I&#x27;ve setup a big .bash_alias to be scp&#x27;d to my machines.<p>functions only for the complicated parts. about the same number of bash aliases as .gitconfig aliases.
gigatexalalmost 3 years ago
I mostly use functions not aliases but I’m not that much of a power user.
评论 #31552286 未加载
flaburganalmost 3 years ago
I&#x27;m using them a lot for git. I have aliases for all the git commands.
twangistalmost 3 years ago
&gt; Aliases just don&#x27;t stick in my memory.<p>`$ alias` will show you your aliases, and it&#x27;s a pretty easy command to remember ;)
评论 #31556728 未加载
cpc26almost 3 years ago
cat .bash_aliases | wc -l<p><pre><code> 61 </code></pre> but yes alias command when I need to work on a system I aliased prior and have not used...<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Memory_span" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Memory_span</a>
db48xalmost 3 years ago
Sometimes. My favorite is alias primetime=&#x27;watch -t -n 1 &quot;factor \$(date +%s)&quot;&#x27;