6 ms·
Ask HN: What's one Linux command you wish you'd learned years ago?
- gigatexal 6y agoXargs or awk
- DanBC 6y agoAwk.
- dcminter 6y ago^R in bash to search command history.
- karmakaze 6y agoSimilarly I knew about Ctrl+U delete from cursor to beginning of line but learned of (or had forgotten about) Ctrl+K delete from cursor to end of line many years later.
- stevekemp 6y agoThis comes from readline, and there are many many useful shortcuts. For example "M-." (i.e. "Escape", then ".") to insert the last argument of the previous command. This is great when you run something like: ls /path/to/foo cd M-.
- UrbanPiper 6y agoTmux and Vim for me - they are tools and not exactly commands.
- deanmoriarty 6y agofzf as command history search, coupled with an unlimited history file. It is by far my “unfair advantage”, I do things so much faster than my coworkers...
- thiht 6y agoAs someone who massively use Ctrl+r and history|grep, I don't get it. Can you elaborate, with examples if possible?
- tacone 6y agoshutdown :)
- jolmg 6y agopoweroff
- arkj 6y agofind ... -exec ... {}\;
- p0d 6y agotailf
- e-woke 6y ago:q
- simonblack 6y agosed, tr.
- jamieweb 6y agotac
- theSealedTanker 6y agoman
- asicsp 6y agosed, awk or even the fact that I could've used perl from command line sed -i 's/old/new/g' alone would have saved me lot of time instead of fiddling with a perl script everytime Also, I would've liked to understand shell concepts like file redirections, command substitution, parameter expansion, difference between stdout/stderr, why sometimes I got an error for too many file arguments, or even knew that there existed sites like https://mywiki.wooledge.org/BashFAQ https://mywiki.wooledge.org/BashFAQ and stackoverflow/unix.stackexchange and https://www.shellcheck.net/ https://www.shellcheck.net/ and https://explainshell.com/ https://explainshell.com/ and so on.
- m3adow 6y agoJust as an addition to the OP comment: "perl -pe 's/old/new/g'" is the perl pendant for sed. The obvious advantage is the support for Perl regexes. Also there's the "-r" switch for sed which extends Regexes compatibility.
- deleted 6y ago[deleted]
- pseudonymousgun 6y agowatch command
- BenjiWiebe 6y agopushd popd cd -