DEV Community

Discussion on: Dirty tip: How to remember weird commands you sometimes need

Collapse
 
pcmagas profile image
Dimitrios Desyllas

AFAIK Unix-based systems that rely on bash such as Linux and FreeBSD allows you to provide aliases just edit your .bashrc and place the following allias:

alias POSTGRESFIX="rm -f /usr/local/var/postgres/postmaster.pid"

So once you type POSTGRESFIX in shell environment, problem gets fixed.

Collapse
 
moopet profile image
Ben Sinclair

Turn them into aliases!

 history | grep '[A-Z]FIX' | sed -e 's/^[ 0-9]*//' -e 's/ /="/' -e 's/$/"/' >> ~/.bashrc
Collapse
 
zcserei profile image
Cserei Zoltán

this one is really nice, thanks!

Collapse
 
pcmagas profile image
Dimitrios Desyllas

So I think you can try it on the MAC.

Collapse
 
pcmagas profile image
Dimitrios Desyllas • Edited

Also, most GNU/Linux distros using bash, have a specified test file for aliases in your home folder named .bash_aliases, allowing to place any alias declaration there.

Though, I am not too sure in MacOs because Idk how MasOs has setup bash on their OS.