alias hadouken='sudo $(history -p !!)'
Ask HN: Best things in your bash_profile/aliases?
111–120 of 288 posts
Re: Ask HN: Best things in your bash_profile/aliases?
#112alias ll='ls -l'
Re: Ask HN: Best things in your bash_profile/aliases?
#113 export MAKEFLAGS=-j`nproc`
make will automatically parallelize builds for the number of cores on the machine. It also breaks various things interestingly, particularly build systems which don't pay attention to correct dependences.Re: Ask HN: Best things in your bash_profile/aliases?
#114I found myself needing to use deeply nested tmux sessions a few times and navigating between nestings is a huge pain under a vanilla setup. Using some configuration trickery, I was able to hack in keys to "focus" between nesting levels. Here's a repo I have it sitting under:
https://github.com/xelxebar/tmux-addons/tree/master/nesting
The code should be relatively drop-in and the README not terrible.
I'd love to hear thoughts.
Re: Ask HN: Best things in your bash_profile/aliases?
#115This is tiny, but I've gotten a surprising amount of mileage out of aliasing 'fx' to firefox --new-instance --profile $(mktemp -d) which pops open a new instance of Firefox with a completely clean, temporary profile. Super useful for testing sites or add-ons without influencing (or being influenced by) by my normal browsing profile.
I have a similar command, except it keeps the existing addons from my main profile. Which is useful as I need a proxy for different environments for work.
Re: Ask HN: Best things in your bash_profile/aliases?
#116Stuff like:
alias @projectName="cd $project && alias java='/some/specific/version' && export SOME_VAR=value"
or
alias @untrustedWifi="tor && torbrowser && set up an SSH tunnel to access mail etc"
I can't really share the actual contents, because they depend on a boatload of scripts in my ~/bin dir and they're all pretty specific to my environment.
Re: Ask HN: Best things in your bash_profile/aliases?
#117 alias.gerritpush=push origin HEAD:refs/for/develop
alias.fixlast=!git commit -a --fixup=HEAD && GIT_EDITOR=true git rebase -i --autosquash HEAD~2
alias.loglast=log -n 1 -pRe: Ask HN: Best things in your bash_profile/aliases?
#118Can I add something from .vimrc? If you put the commands: set undofile set undodir=~/.vim/undodir You get infinite undo in your files. Now when you go into a file, delete or add some text and close your terminal down, the next time you enter vim you can (re|un)do previous operations. Has saved my ass more times than I care to mention over my career!
Re: Ask HN: Best things in your bash_profile/aliases?
#119I have a whole repository also including several dotfiles that I maintain for already several years [1]. Following are some snippets from the dotfiles/.alias and dotfiles/.functions files from that repository that probably are the most interesting and which I am using on a regular basis: # easier navigation alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias ~="cd ~" # Ge…
How often do you use that and how often do you get it right? :-)
My cd related aliases are the following. Especially the . is surprisingly useful, although most of the time I only use .2 and .3
alias ..='cd ../'
alias .1='cd ../'
alias .2='cd ../../'
alias .3='cd ../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../../'
# sometimes, the space gets swallowed
alias cd.='cd .'
alias cd..='cd ..'
But that gave me an idea for another useful directory changer: "go to project root".Project root definition could vary, although nowadays it is probably "go to the first directory upstream with a .git directory"
Edit: found this elsewhere in this discussion posted by jgresty https://news.ycombinator.com/item?id=18901834
# go to root git directory
alias cdgit='cd $(git rev-parse --show-toplevel)'Re: Ask HN: Best things in your bash_profile/aliases?
#120This is tiny, but I've gotten a surprising amount of mileage out of aliasing 'fx' to firefox --new-instance --profile $(mktemp -d) which pops open a new instance of Firefox with a completely clean, temporary profile. Super useful for testing sites or add-ons without influencing (or being influenced by) by my normal browsing profile.
Not exactly a bash alias, but might be useful too: Since I often get bug reports for specific versions of firefox, i've set up a small script for downloading and starting a given firefox version: https://pastebin.com/t2PHxJqE