For devs on the move
I spend a lot of time curating notes about server administration and programming. I'm going to start moving them to this blog in the hopes they are useful to others.
So over the pandemic is spent a lot of time working on my command-line kung-fu. Here are some of the moves I've picked up.
I was using the standard terminal that came with my OS for a while. Moving to Alacritty was not difficult. It just works for me and leverages my bad ass graphics card where a lot of other terminals simply don't. I spend a LOT of time at the command line ( including writing code ), might as well drive the sports car.
I moved from bash into zsh and this was rather amazing. Things just worked better. Completion, vi bindings, plugins. Oh-my-zsh was an adventure that payed off.
If you're not using FZF yet, it's life changing. It adds fuzzy finding to many areas of your system ( think command history ) where it didn't exist before. It's a longer read but worth every second.
Using find was my goto. There was some cognitive dissonance about the number of keystrokes required. It honors a few .ignorefiles as well so your not wasting time and system resources searching things you typically would not want to.
This is like ranger but not. I often forget my file system structure or I can't remember the file name so I ended up cd'ing around - fuck that. NNN is my file explorer with cool plugins.
grep things but like... fast. Enough said.
Better than cat
s but watch out for rabies.
I use this -- A LOT. Instead of cd ~/deep/long/dir/i_totally_forgot
do z _forgot
Putting together a complex command can be challenging especially if you are new to the shell. It's common you want to run a command that you built a looooong time ago, but can't find it in your history. If it's more complex, well shit, you have to take the time to reconstruct it.
Pet is searchable (fzf) command history, saved to github, and synced to whatever shell computer you want - all commands you've saved across all your shells. Sign me up ffs!
Use githubs gist without leaving the cli. In a new project I do
Ctl + r
for my command history and fzf-fuzzy-search for 'ignore'
gist -r ec7bdefe3c86a650c4404adjreiutasdv > .gitignore
and my latest and greatest ignore file is populated for my new project. You'll need to install ruby for this gem however.
This allows you to sync with cloud based file managers like Gdrive / Onedive / Dropbox / and many more. I like to automate my backups so being able to do these things in the middle of the night in an automated way is golden.