CLI Random Tips¶
Adding Commands¶
When you download an application using wget, you can add it to your command directory rather than updating your PATH variable.
wget DOMAIN-TO-DOWNLOAD-APPLICATION
tar -xf APPLICATION-TARFILE-NAME
cd APPLICATION-EXTRACTED-DIRECTORY
ls
install APPLICATION-NAME /usr/local/bin
Forgetting Sudo¶
It turns out this is such a common occurance, there's a shortcut for when it happens. Rather than punching that up arrow, CTRL+A to the beginning, you can just sudo !!
and it will apply sudo to whatever your last command was.
sudo !!
Read the Error Message!¶
This sounds like common sense, but it turns out that I'm not alone in sometimes getting caught up in what I thought the error was that if I'd just read the error output, it would have led me to the issue quicker.
Pipe Output to vim -
¶
If you don't know where you want to put the output of a command yet
grep -Hnri "chacho" | vim -
:%!
to run the output back through another command:
:%!grep -v sushi
:%!sort