Skip to content

Instantly share code, notes, and snippets.

@dotCipher
Last active March 30, 2024 08:23
Show Gist options
  • Save dotCipher/60c933c7da8a319db8bc to your computer and use it in GitHub Desktop.
Save dotCipher/60c933c7da8a319db8bc to your computer and use it in GitHub Desktop.
oh-my-zsh mac aliases
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'
# Copy pwd to clipboard
alias cpwd='pwd | tr -d "\n" | pbcopy'
# Basic directory operations
alias ...='cd ../..'
alias ..2='cd ../..'
alias ..3='cd ../../..'
alias ..4='cd ../../../..'
alias ..5='cd ../../../../..'
# Quick clear
alias c='clear'
# Super user
alias _='sudo'
alias please='sudo'
# IP (default to ipv4)
alias ipv6='curl -6 icanhazip.com'
alias ipv4='curl -4 icanhazip.com'
alias ip='ipv4'
alias cpip='ip | pbcopy'
# New commands
alias path='echo -e ${PATH//:/\\n}'
# Zsh profile shorcuts
alias zshrc='$EDITOR ~/.zshrc'
alias zshalias='$EDITOR ~/.oh-my-zsh/lib/aliases.zsh'
# Show history
if [ "$HIST_STAMPS" = "mm/dd/yyyy" ]
then
alias history='fc -fl 1'
elif [ "$HIST_STAMPS" = "dd.mm.yyyy" ]
then
alias history='fc -El 1'
elif [ "$HIST_STAMPS" = "yyyy-mm-dd" ]
then
alias history='fc -il 1'
else
alias history='fc -l 1'
fi
# List direcory contents
alias lsa='ls -lah'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'
alias afind='ack-grep -il'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment