-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
118 lines (85 loc) · 2.7 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/env sh
# relative navigation shortcuts
alias .='echo $PWD'
# clear the screen and scrollback buffer
alias cls='printf "\33c\e[3J"'
# use interactive mode as a safeguard
alias cp='cp -i'
alias ln='ln -i'
alias mv='mv -i'
alias rm='rm -i'
# list only non-hidden entries
alias ll='ls -lhF'
# list only hidden (dotfile) entries
alias l.='ls -dF .*'
alias ls.='ls -dF .*'
alias ll.='ls -lhdF .*'
# list only sub-directory entries
alias lsd='ls -ldeh */'
# list all entries
alias lla='ls -alhF'
# list all entries, include ACL attributes
alias lle='ls -alheF'
# sort listing by size
alias llS='ls -alheFS'
# display complete time stamps
alias llT='ls -alheFT'
# grep the directory listing, ignore-case
alias llg='ls -alheF | grep -i'
# paginate listing
alias lll='ls -alheF | less -M'
alias llm='ls -alheF | most'
# always long list the directory stack
alias dirs='dirs -v'
# long list the stack after pop
alias popd='popd &> /dev/null; dirs -v'
# supress stack list after push
alias pushd='pushd > /dev/null'
# Long lists the active jobs in the current shell
alias jobs='jobs -l'
# create parent directories as needed
alias mkdir='mkdir -pv'
# pretty print PATH variable
alias path='echo -e ${PATH//:/\\n}'
# grep processes, ignore-case
alias psg='ps aux | grep -i'
# only show one level by default when running tree command
alias tree='tree -L 1'
# fix unintuitive unix command names
alias unmount='umount'
# output random hexidecimal gradoo
alias gradoo='cat /dev/urandom | hexdump -C | grep "ca fe"'
# Git (alternately use gitsh)
alias amend='git commit --amend'
alias branch='git checkout -b'
alias branches='git branch --all'
alias checkout='git checkout'
alias commit='git commit'
alias rebase='git rebase'
alias remotes='git remote --verbose'
alias stage='git add'
alias stash='git stash'
alias status='git status'
alias switch='git switch'
alias unstage='git reset HEAD'
# Git Large File Storage
alias lfs='git lfs'
# OpenSSL checksums
alias digest='/usr/bin/openssl dgst'
# SQLite
alias sqlite='sqlite3'
### macOS specific
# Recursively delete .DS_Store files starting from the current directory
alias delete_ds_store="sudo find . -type f -name '.DS_Store' -ls -delete"
# flush directory service and local DNS cache
alias resetDNS='sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder && echo "macOS DNS Cache Reset"'
# Merge PDF files
# Usage: `mergepdf -o output.pdf input{1,2,3}.pdf`
alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py'
# Preview
alias preview='open -a /Applications/Preview.app'
# Safari
alias safari='open -a /Applications/Safari.app'
# Quick Look (^C or SPACE to close)
alias qlp='qlmanage -p 2>/dev/null'
alias qlr='qlmanage -r cache'