Here's a round up of all the neat stuff that was posted under @tlakomy's tweet on lesser known utilities/commands. Enjoy!!!
And don’t run random commands from Twitter in your terminal before making sure it does what you think it does. You can use explainshell.com to learn a little bit first before you endanger your system. YES AN ASSHAT TRIED TO SUGGEST
rm -rf IN ROOT. Don't do that. Be especially wary of anything that starts with
Let's say you're in the middle of something and you spot a rabbit hole you want to dig into, but you don't want to lose where you are. Fear not! You can use
pushd to go to the new directory and then
popd will return you back once you're done. This is nice when
cd - just won't cut it.
pushd and popd— Bruised thumb (@danclark) May 2, 2020
I really want to go to that other directory, but I don't want to lose my current one.
Then when you're done popd to return.
Are you struggling with a problem and you want to see the logs.
tail -f the_log_in_question.log is here to save the day! If you're dealing with more files you can run multiple instances of
tail -f Simply do something like this
dan@bruisedthumb:~$ tail -fn0 test.log ^Z + Stopped tail -fn0 test.log dan@bruisedthumb:~$ bg + tail -fn0 test.log & dan@bruisedthumb:~$ tail -fn0 test2.log ^Z + Stopped tail -fn0 test2.log dan@bruisedthumb:~$ bg + tail -fn0 test2.log & dan@bruisedthumb:~$
Here we use ctrl-z to stop each tail and
bg to put that process in the background. So when a line gets written to either one it shows up in your console.
tail -f somelogfile.log— Bruised thumb (@danclark) May 2, 2020
Run this in a separate terminal then start up whatever is blowing up on you. It will show you the log as it's written. If there are multiple logs you can Ctrl-z and then bg the multiple files. Then you'll see the output from all as they happen.
Sorry the summary didn't render properlyMay 2, 2020
vim is scary powerful, and its fanatics are having regularly holy wars with emacs fanatics (well users of any other text editor really). Also sed and awk are cool too.
Also checkout vim. It's SCARY what it can do. I've also heard the same of awk and sed, but I need to find time to learn those.— Bruised thumb (@danclark) May 2, 2020
vim: the text editor that started the first holy war with emacs
sed: can alter text in a number of ways.
awk: I hate that I don't know what this does
It's like vim but not. Also
/ searches the contents. Also you'd never know that english is the only language I know...
Oh I love less. Anytime I need to look at a file I just less that /allows me to search the file. It's like vim!— Bruised thumb (@danclark) May 2, 2020
Can't find something in your project? This searches your git repo for that thing. The -i is case insensitive.
git grep -i "that &%∆©! thing you're looking for"— Bruised thumb (@danclark) May 2, 2020
Searches your git repo for that thing. The -i is case insensitive.
A tip by @ol_lebowski This is used in conjunction with pipes. As pipe tee will elevate to sudo permissions.
sorry tweet doesn't renderMay 2, 2020
How long did that take again? Is it getting faster? Slower? A tip by @schiefewelt
time <your command>, runs a command and measures how long it took.— Umut Topuzoğlu (@schiefewelt) May 2, 2020
Here's a suggested repo by @xbgord. Warning I have not tested or looked too hard at this yet so be careful, but the description sounds really really really neat
Maybe not a command, but search for a command. It was a game changer when I’ve found out about it.— Telmo (@telmo) May 2, 2020
I'll have to try this out on my mac later, but sudo_overflow drops a hint on keeping your terminal tidy.
sigh the summary didn't render again May 2, 2020
As a vim user I respect anyone who doesn't use the arrow keys. Thanks to tweet_rchase for this tip.
sorry the summary didn't renderMay 2, 2020