I realized that I have a bunch of CLI go to commands and aliases that speed up my productivity and was wondering what others use.
A few of my favs:
-
history | grep 'something'- for finding a command I ran in the past -
zz- opens up ~/.zshrc for editing -
wpd- uses my local PHP version to run WP CLI so I can use XDEBUG on the CLI
What are your aliases and CLI goto productivity commands?
Latest comments (24)
I write a fair amount of script-y tooling, so this one saves me a lot of keystrokes:
Some of my
.bashrcaliases:The git shorthands above are actually kind of a lie; I actually have a (probably unnecessarily) complicated couple of bash functions, supported by a python script that parses
git statusoutput and assigns a number to each changed file, to allow easier shorthands.gsshowsgit statuswith the numbers inline before each file, thengaandgdwill accept those numbers as arguments, so I can doga 3to stage the 3rd modified file for commit orgd 3to show the diff for that file. Maybe I'll write a post about those functions at some point so someone can show me how to improve them...At the beginning of the year I broke my arm and was forced to type one handed for 3 weeks. It was ROUGH but because of it I now have a list of super simple 2 letter aliases which I still use :D
I'm using macOS, not sure if things work in other UNIX environments (esp.
pbcopy/pbpasteare macOS-specific), and some commands require external tools like Node.js or PHP to be installed.function rm --description 'alias rm rm -rf'command rm -rf $argv;
end
Wouldn't recommend it to anyone though.
I use βlanβ
ifconfig | grep βinet β
To get my ip address
ip a | grep βinet β
On latest debian releases
I don't use many aliases, but I have replaced ls with exa. It's got saner defaults and great options for neat behaviour like grouping directories first, changing sorting mode, and respecting .gitignore and showing git status in long-form mode.
alias c=clear
alias b=cd..
alias zshrc='vim. zshrc && source ~/. zshrc'
alias ypx='yarn run'
FYI, you can use Ctrl+L in most shells to handle screen clearing, and would allow you to free up 'c' for another action. Also doesn't require an enter key press!