-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
52 lines (39 loc) · 1.39 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
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
alias reload="exec $SHELL -l"
# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias ..d="cd ~/Downloads"
alias ..p="cd ~/Developer"
# Directory
alias md="mkdir -p"
alias rd="rmdir"
alias rmf="rm -rf"
# List directory contents
# Always use color output for `ls`
# Detect which `ls` flavor is in use
if ls --color >/dev/null 2>&1; then # GNU `ls`
LSCOLORFLAG="--color"
else # macOS `ls`
LSCOLORFLAG="-G"
fi
alias ls="command ls ${LSCOLORFLAG}"
alias ll="ls -lF" # long format
alias la="ls -laF" # long format, including dot files
alias ld="ls -lF | grep '^d'" # Directories
alias l.="ls -ld .*" # Dotfiles
# Edit
alias chmox="chmod +x"
# Get today's date
alias today='date +"%A, %B %-d, %Y, Week: %V"'
# Networking
alias myip='dig @resolver4.opendns.com myip.opendns.com +short'
alias myip4='dig @resolver4.opendns.com myip.opendns.com +short -4'
alias myip6='dig @resolver1.ipv6-sandbox.opendns.com AAAA myip.opendns.com +short -6'
# Recursively delete `.DS_Store` files
alias dscleanup="find . -name '*.DS_Store' -type f -ls -delete"
# Clean up LaunchServices to remove duplicates in the “Open With” menu
alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
# General ssh key
alias copyssh="pbcopy <~/.ssh/id_rsa.pub"