Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
bd = cd ..
iwant = sudo apt-get install
bye = exit
gs = git status
gp = git pull
gcm = git checkout master
test = /var/www/html/test
Etc.... I have lots of alias to fasten things... -
Root826007y@zshh it's a bash function, actually, not an alias.
In ~/.bash_profile (or similar):
function cdls {
cd $1
ls
}
Couldn't be any simpler. -
zshh38537y@Ashkin Awesome, and I learned you don't even need the alias when you're defining a function. TIL :)
-
epse36617yI have function called take that makes a directory and cd's into it but it's quite too long to type here
-
Root826007y@epse
function take {
mkdir $1
cd $1
}
// ???
Those I suppose it should do error checking, too, and handle multiple directories. A loop with sed/awk would do. -
I got a few functions myself
#cleans up unused docker trash
dockerclean(){
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
}
#retry command until it works, old command from dialup days but still being used
retry(){
$@
if [ ! $? -eq 0 ]; then
retry $@
fi;
}
#spell check for php
sc(){
find . -iname \*.php -exec aspell --mode=html check '{}' \;
}
#per-directory env variables
cd(){
builtin cd "$@"
[ -f './.env' ] && . .env
}
[ -f './.env' ] && . .env -
Your 'gforbm' is just 'the' for me. Also:
alias g=git
alias gst=git status (can't remember options)
alias gd=git diff
alias ga.=git add .
alias gaa=git add --all
alias gp=git push -
gs = git status
gpp = git pull && git push
gaa = git add .
ga = git add
gg = git commit
pa = php artisan (for laravel)
project = cd /var/www/html
dir = ll
Etc.
Related Rants
Share your own useful terminal aliases here:
- grm=git rebase origin master
- gforbm=git fetch origin && git rebase origin master
- vm=vim Makefile
- idea=vim ~/repos/ideas/README.md (where I store all my programming ideas)
undefined
terminal life
terminal
alias
terminal alias