forked from hougasian/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_alias
80 lines (64 loc) · 2.76 KB
/
.bash_alias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
alias ls='ls -GhF' # linux: --color=auto; Mac: -G
alias lr='ls -R' # recursive ls
alias ll='ls -lG'
alias la='ll -AG'
alias lx='ll -BX' # sort by extension
alias lz='ll -rS' # sort by size
alias lt='ll -rt' # sort by date
alias lm='la | more'
alias tree='tree -Csu' # alternative to 'recursive ls'; Must have tree installed. For homebrew: $ brew install tree
# Add some color to grep
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# Other usefuls
alias ports='netstat -tulanp' # show open ports
alias mkdir='mkdir -pv' # mkdir, create parent
alias h='history'
alias j='jobs -l'
alias cls='clear'
alias which='type -a'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Some help with du
alias du='du -kh' # a more readable output.
alias df='df -kTh'
# Make Bash nicer
alias :q=' exit'
alias :Q=' exit'
alias :x=' exit'
alias ..='cd ..'
alias ...='cd ../..'
alias ~="cd ~"
# reloads the prompt, usefull to take new modifications into account
alias reload="source ~/.bashrc"
# Memory
alias meminfo='free -m -l -t' # pass options to free
# get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
# get top process eating cpu
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
alias cpuinfo='lscpu' # Get server cpu info
# get GPU ram on desktop / laptop##
alias gpumeminfo='grep -i --color memory /var/log/Xorg.0.log'
# Network
alias ip="dig +short myip.opendns.com @resolver1.opendns.com" # your public ip
alias localip="ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'" # your local ip
alias lsnet='sudo lsof -i' # lsnet: Show all open TCP/IP sockets
alias flushDNS='dscacheutil -flushcache' # flushDNS: Flush out the DNS Cache
alias openPorts='sudo lsof -i | grep LISTEN' # openPorts: All listening connections
alias showBlocked='sudo ipfw list' # showBlocked: All ipfw rules inc/ blocked IPs
# VNC
alias vnc='/System/Library/CoreServices/Screen\ Sharing.app/Contents/MacOS/Screen\ Sharing'
# disables shadow on screenshots
# defaults write com.apple.screencapture disable-shadow -bool true
# MacDown (markup editor)
alias md='open -a /Applications/MacDown.app/'
alias ownit='sudo chmod -R o+w /Library/WebServer/Documents' # ownership of WebServer docs folders
alias vhosts='sudo vim /etc/apache2/extra/httpd-vhosts.conf' # edit vhosts file
alias hosts='sudo vim /etc/hosts' # edit hosts file
alias a='atom' # quickly launch Atom (https://atom.io/)
alias err="tail -f /var/log/apache2/error_log" # quickly tail apache error log