You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Clean up LaunchServices to remove duplicates in the “Open With” menu
99
87
alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
100
88
101
-
# Canonical hex dump; some systems have this symlinked
102
-
command -v hd > /dev/null || alias hd="hexdump -C"
89
+
# Get external IP address
90
+
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
91
+
92
+
# Get internal IP address (depends on network interface, see `ifactive`)
93
+
alias localip="ipconfig getifaddr en5"
103
94
104
-
# macOS has no `md5sum`, so use `md5` as a fallback
105
-
command -v md5sum > /dev/null || alias md5sum="md5"
95
+
# List all IPv4 and IPv6 addresses associated with all network interfaces on the system
96
+
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
106
97
107
-
# macOS has no `sha1sum`, so use `shasum` as a fallback
108
-
command -v sha1sum > /dev/null || alias sha1sum="shasum"
98
+
# Show active network interfaces
99
+
alias ifactive="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'"
109
100
110
101
# Trim new lines and copy to clipboard
111
102
alias c="tr -d '\n' | pbcopy"
112
103
113
104
# Recursively delete `.DS_Store` files
114
105
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
115
106
116
-
# Empty the Trash on all mounted volumes and the main HDD.
117
-
# Also, clear Apple’s System Logs to improve shell startup speed.
118
-
# Finally, clear download history from quarantine. https://mths.be/bum
119
-
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl; sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'"
120
-
121
107
# Show/hide hidden files in Finder
122
-
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
123
-
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
108
+
alias showhidden="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
109
+
alias hidehidden="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
124
110
125
-
# Hide/show all desktop icons (useful when presenting)
126
-
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
111
+
# Show/hide all desktop icons (useful when presenting)
127
112
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
113
+
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
128
114
129
115
# Open random file in folder
130
116
alias random-file="find . -type f | shuf | head -n1 | xargs -I {} open {}"
0 commit comments