Folder Git[0], a quick hack to for example pull all my 100+ repos in one go. First version eight years ago, and I still use it every day. [0] https://gitlab.com/victor-engmark/fgit/blob/9575803b3bf277d5...
Ask HN: Best things in your bash_profile/aliases?
211–220 of 288 posts
Re: Ask HN: Best things in your bash_profile/aliases?
#212One useful alias I have not seen mentioned here is this: alias myip='curl -s https://api.ipify.org' Just prints out my current public IP address. I also have a bunch of others mentioned in this thread, and I've abbreviated a bunch of self-explanatory docker-compose commands, e.g. dcdown, dcup, dcrestart, dcpullup, etc
Re: Ask HN: Best things in your bash_profile/aliases?
#213I 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…
You might enjoy replacing your extract function with atool ( https://www.nongnu.org/atool/ ) which provides aunpack. It works similarly, but has niceties like creating and unpacking into a subdirectory to avoid accidentally spraying files all over the current working directory if the archive has multiple files at its root.
Re: Ask HN: Best things in your bash_profile/aliases?
#214Zsh function to create a directory and cd into it in one go: function mkcd() { mkdir -p "$@" && eval cd "\"\$$#\""; }
Re: Ask HN: Best things in your bash_profile/aliases?
#215Not strictly an alias, but autojump has been a huge productivity booster for me. Installing it sets up an alias of `j` which guesses the best directory to cd to based on your cd history. So instead of having to type `cd ~/Projects/someproject` you could just type `j some` and it'll end up there. https://github.com/wting/autojump
>cd ~/Projects/someproject
>wd add . some
From then on you can use `wd some` to warp to that dir.
[1]: https://github.com/kigster/warp-dir
Re: Ask HN: Best things in your bash_profile/aliases?
#216Re: Ask HN: Best things in your bash_profile/aliases?
#217Not strictly an alias, but autojump has been a huge productivity booster for me. Installing it sets up an alias of `j` which guesses the best directory to cd to based on your cd history. So instead of having to type `cd ~/Projects/someproject` you could just type `j some` and it'll end up there. https://github.com/wting/autojump
Shoutout as well to the various `warp` implementations[1,2,3]. Instead of guessing, you set "warp points" so for your example you can do something like: >cd ~/Projects/someproject >wd add . some From then on you can use `wd some` to warp to that dir. [1]: https://github.com/kigster/warp-dir [2]: https://github.com/mfaerevaag/wd [3]: https://github.com/troyxmccall/wd
Re: Ask HN: Best things in your bash_profile/aliases?
#218Since I'm working in git repos the majority of the time, I type these hundreds of times per day: alias s="git status" alias d="git diff" I prefer looking at this stuff in a terminal rather than an IDE. Reducing them to a single character just feels so good. Note: not a git alias like "git s", literally just the single character "s" in Bash itself. And coming in third: alias ..="cd .."
alias ci='git commit'
alias co='git checkout'
alias d='git diff'
alias dc='git diff --cached'
alias l='git log --oneline --graph --all --decorate'
alias ru='git remote update'
alias s='git status'Re: Ask HN: Best things in your bash_profile/aliases?
#219My favorite new one that I have been using a lot: function cheat() { curl cht.sh/$1 } It queries the cht.sh cheatsheet of various Unix commands. 'cheat tar' prints: # To extract an uncompressed archive: tar -xvf /path/to/foo.tar # To create an uncompressed archive: tar -cvf /path/to/foo.tar /path/to/foo/ # To extract a .gz archive: tar -xzvf /path/to/foo.tgz # To create a .gz archive: tar -czvf /path/to/foo.tgz /path…
Re: Ask HN: Best things in your bash_profile/aliases?
#220This one is pretty useful! Open current OSX Finder directory in Terminal: cdf () { target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'` if [ "$target" != "" ] then cd "$target" pwd else echo 'No Finder window found' >&2 fi }
can't you just wite "cd" and drag the folder into the terminal?