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
.bashrc
aliases: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 status
output and assigns a number to each changed file, to allow easier shorthands.gs
showsgit status
with the numbers inline before each file, thenga
andgd
will accept those numbers as arguments, so I can doga 3
to stage the 3rd modified file for commit orgd 3
to 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
/pbpaste
are 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!
alias dc="docker-compose"
npr
: Run Node scripts in package.jsonvi-s
: As inVim session
to resume my work on a project using neovim.pomd
: Starts a tmux session named pomodoro or creates one if it doesn't. I used it to track the time on my working session.pmd-start
: Is what start the working session using this handy tool.dcc-up
: Starts docker compose in detach mode.dcc-down
: Stops docker compose.Another handy tool for searching that I recommend is fzf.
ripgrep + fzf + Ctrl-R to search is the bee's knees.
Awesome find with
gone
. I'm gonna have to add that to my arsenal (no more browser tab pomodoro!)Useful git history (I absolutely ❤️ this one):
Clean up stray docker containers/images (it's a personal script not an alias):
I use
i3wm
andfish-shell
, so I aliased:So that VSCode opens up immediately to edit those files whenever I need.
I also really like the Git-bare approach to syncing Config-files, so I have
Which roughly translates to
pt
= Integration + Unit Tests,dt
= tests that uses a real browser (IDK the correct term for this) andtest
= run the whole suite.