Last active
December 28, 2018 13:36
-
-
Save xillwillx/67dad7203ab0e8a921061c681621f101 to your computer and use it in GitHub Desktop.
Mac ~/.bash_profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH="$PATH:/usr/bin/" | |
alias ll='ls -GFHAf -1' # ll: directory listing in 1 column | |
alias f='open -a Finder ./' # f: Opens current directory in MacOS Finder | |
alias cpwd='pwd|tr -d "\n"|pbcopy' # cpwd: copy the working directory path | |
alias ..="cd ../" | |
alias ...="cd ../../" | |
alias ....="cd ../../../" | |
alias wttr='curl wttr.in/06451?0u' | |
alias myip='curl -s http://whatismyip.akamai.com/' ;echo | |
alias localip="ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'" ;echo | |
echo 'External IP:' ;myip | |
echo 'WIFI IP:' ;ipconfig getifaddr en0 | |
echo ;wttr ; echo | |
temp=$(expr $(sysctl machdep.xcpm.cpu_thermal_level | tail -c 3) \* 9 / 5 + 32) | |
echo $temp"˚F is your CPU temp."; echo | |
alias cputemp=$temp | |
# extract: Extract most know archives with one command | |
# --------------------------------------------------------- | |
extract () { | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xjf $1 ;; | |
*.tar.gz) tar xzf $1 ;; | |
*.bz2) bunzip2 $1 ;; | |
*.rar) unrar e $1 ;; | |
*.gz) gunzip $1 ;; | |
*.tar) tar xf $1 ;; | |
*.tbz2) tar xjf $1 ;; | |
*.tgz) tar xzf $1 ;; | |
*.zip) unzip $1 ;; | |
*.Z) uncompress $1 ;; | |
*.7z) 7z x $1 ;; | |
*) echo "'$1' cannot be extracted via extract()" ;; | |
esac | |
else | |
echo "'$1' is not a valid file" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment