Ask HN: What's one Linux command you wish you'd learned years ago? - yarapavan
======
asicsp
sed, 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
Just 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.

------
deanmoriarty
fzf 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
As someone who massively use Ctrl+r and history|grep, I don't get it. Can you
elaborate, with examples if possible?

------
UrbanPiper
Tmux and Vim for me - they are tools and not exactly commands.

------
dcminter
^R in bash to search command history.

~~~
stevekemp
This 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-.

------
gigatexal
Xargs or awk

------
pseudonymousgun
watch command

------
theSealedTanker
man

------
e-woke
:q

------
DanBC
Awk.

------
arkj
find ... -exec ... {}\;

------
BenjiWiebe
pushd popd cd -

------
tacone
shutdown :)

~~~
jolmg
poweroff

------
jamieweb
tac

------
simonblack
sed, tr.

------
p0d
tailf

