Reload bash_profile

Apply any changes made to ~/.bash_profile with reload: alias reload='source ~/.bash_profile'

Network Connections

List all network connections with nets: alias nets='lsof -i'

Internet Speed test

Speed test using a 100Mbyte file from OVH Hosting:

alias speedtest='curl -o /dev/null http://ovh.net/files/100Mio.dat'

WAN IP Address

Show WAN IP address with myip: alias myip='curl ifconfig.co'

Web Server Banner

A curl function to grab web server banner information with headers followed by a URL:

headers () { /usr/bin/curl -X GET -I -L -k -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36' $@ ; }

Website HTML Source

A curl function to view a web page’s html source with view-source followed by a URL:

view-source () { /usr/bin/curl -L -k -A 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0' $@ ; }

File Header

View the first few bytes of any file with filehead followed by a filename:

filehead () { /usr/bin/xxd -u -g 1 $@ | /usr/bin/head ;}

List and Directory

alias cp='cp -iv'
alias mv='mv -iv'
alias mkdir='mkdir -pv'
alias ll='ls -FGlAhp'
alias less='less -FSRXc'
alias CD='cd'
alias cd..='cd ../'
alias ..='cd ../'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ~='cd ~'
alias c='clear'

Combined

Just copy and paste within your ~/.bash_profile or ~/.bashrc and run source.

# Reload
alias reload='source ~/.bash_profile'

# Network
alias nets='lsof -i'
alias myip='curl ifconfig.co'
alias speedtest='curl -o /dev/null http://ovh.net/files/100Mio.dat'

# Server Headers
headers () { /usr/bin/curl -X GET -I -L -k -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36' $@ ; }

# View Page Source
view-source () { /usr/bin/curl -L -k -A 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0' $@ ; }

# File Header
filehead () { /usr/bin/xxd -u -g 1 $@ | /usr/bin/head ;}

# Common
alias cp='cp -iv'
alias mv='mv -iv'
alias mkdir='mkdir -pv'
alias ll='ls -FGlAhp'
alias less='less -FSRXc'
alias CD='cd'
alias cd..='cd ../'
alias ..='cd ../'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ~='cd ~'
alias c='clear'