3 ms·
Ask HN: (2018) What are some of your favorite Unix command line aliases?
By which I mean either aliases or short bash functions.
Examples:
# download a video from YouTube or other major sites, recoding if needed into .mp4 format
alias yt='youtube-dl --recode-video mp4'
# empty the pasteboard (macOS only) [edit: fixed description]
alias pbclear='echo "" | pbcopy'
# remove formatting from text in pasteboard (macOS only)
alias pbclean='pbpaste | pbcopy'
# remove a directory even if it contains .DS_Store files (macOS specific)
function rmdir() {
[[ -e "$@/.DS_Store" ]] && /bin/rm "$@/.DS_Store"
/bin/rmdir "$@"
}
# go to the "Feeling Lucky" result for a Google search
lucky () { open "http://www.google.com/search?hl=en&q=`echo $* | sed "s/ /%20/g"`&btnI"; }
- otras 9y agoWhile the git-completion.bash [0] function isn't short, this small addition to my bashrc has made my life much easier: if [ -f ~/.git-completion.bash ]; then . ~/.git-completion.bash fi [0] https://github.com/git/git/blob/master/contrib/completion/git-completion.bash https://github.com/git/git/blob/master/contrib/completion/gi...
- mathieubordere 9y agosome small ones I use. alias x="xdg-open" alias update="sudo apt-get update; sudo apt-get upgrade"