Skip to content

Instantly share code, notes, and snippets.

@tracertea
tracertea / find:ignore_a_subdirectory
Created October 30, 2014 15:58
list the contents of all files within a directory while ignoring specific subdirectories
find . -type f -not -path "*PATH1/*" -not -path "*MULTI/PATH2/*"
@tracertea
tracertea / gpg:decrypt
Created October 30, 2014 16:00
GPG/PGP decrypt cipher text
gpg -o decrypted_plain.txt -d cipher.asc
@tracertea
tracertea / pbpaste:pipe_from_clipboard
Created October 30, 2014 16:03
clipboard contents into terminal OSX
pbpaste >
@tracertea
tracertea / pbcopy:pipe_to_clipboard
Created October 30, 2014 16:05
copy output to clipboard OSX
| pbcopy
@tracertea
tracertea / ack:terminal_output_highlight
Created October 30, 2014 16:10
highlight terminal output inline
| ack --passthru "REGEX"
@tracertea
tracertea / find,grep:grep_with_file_and_line_number
Created October 30, 2014 16:14
grep output with filename and line number
find . -type file -exec grep -iEn "REGEX" {} /dev/null \;
@tracertea
tracertea / find,echo,plutil:plist_dump
Created October 30, 2014 16:16
display the contents of all plist files within a directory recursively OSX
find . -name "*.plist" -exec echo {} \; -exec plutil -p {} \;
@tracertea
tracertea / fuser:port_to_pid
Created December 29, 2014 16:27
display the process id associated with a port
fuser 8000/tcp
@tracertea
tracertea / fuser:kill_pid_associated_with_port
Created December 29, 2014 16:28
kill pid associated with port
fuser -k 8000/tcp
@tracertea
tracertea / find:delete_empty_subdirectories
Last active August 29, 2015 14:24
delete all empty sub directoires
find . -type d -empty -delete