-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
40 lines (31 loc) · 1.28 KB
/
.aliases
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
# Always enable colored `grep` output
alias grep='grep --color=auto '
# Allias
alias ls='ls -Gp'
alias cp='cp -iv'
alias mv='mv -iv'
alias mkdir='mkdir -pv'
alias ll='ls -FGlAhp'
alias cat='bat'
# History
alias h='history'
alias hs='history | grep'
alias hsi='history | grep -i'
# Lock the screen (when going AFK)
alias afk="osascript -e 'tell application \"System Events\" to keystroke \"q\" using {command down,control down}'"
alias goodnight="sudo shutdown -r now"
alias restart="sudo shutdown -h now"
# Application
alias start='open -a $1'
# list all "Host" and "HostName" lines, then remove the strings: "Host " and "HostName "
alias sshhosts="grep -w -i -E 'Host|HostName' ~/.ssh/config | sed 's/Host //' | sed 's/HostName //'"
# Open a folder in MacOS Finder
alias f='open -a Finder ./'
# IP addresses
alias pubip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="sudo ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'"
alias ips="sudo ifconfig -a | grep -o 'inet6\\? \\(addr:\\)\\?\\s\\?\\(\\(\\([0-9]\\+\\.\\)\\{3\\}[0-9]\\+\\)\\|[a-fA-F0-9:]\\+\\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# qfind Quickly search for file
alias qfind="find . -name "
# Reload ZSH config
alias zshreload=". ~/.zshrc"