Skip to content

Instantly share code, notes, and snippets.

@tzmartin
Last active November 17, 2019 02:05
Show Gist options
  • Save tzmartin/0a8fd90ca9be3dd89528 to your computer and use it in GitHub Desktop.
Save tzmartin/0a8fd90ca9be3dd89528 to your computer and use it in GitHub Desktop.
Handy Linux Commands

Change OSX screen shot (cmd + shf + 3) file location and name

defaults write com.apple.screencapture name "SCREENSHOT"
defaults write com.apple.screencapture location /Users/tzmartin/Documents/screenshots
killall SystemUIServer

Kill service

ps aux | grep node
kill -9 PROCESS_ID

Retrieve Command Line Arguments

Run a normal process listing through Terminal:

ps auxww

The ww options are BSD syntax for a wide listing. You can also use:

ps -ef

for the now commonly used POSIX syntax.

Example output, where you can see the arguments of various processes:

USER       PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
werner   22208   3.8  0.1   187288   4692   ??  SN    2May12 373:03.43 CocoaDialog progressbar --indeterminate --title LaTeX Watch --text LaTeX Watch: Compiling document
werner    9860   3.0  1.9   694776 161780   ??  S    Fri06PM  26:18.32 /Applications/Skype.app/Contents/MacOS/Skype -psn_0_133185276
werner    9791   2.4  0.4  2918396  30876   ??  S    Fri06PM   0:19.30 /Applications/iTerm.app/Contents/MacOS/iTerm -psn_0_133144306
werner    9718   2.2  0.8   531556  67940   ??  S    Fri06PM  24:10.68 /Applications/Google Drive.app/Contents/MacOS/Google Drive -psn_0_132955844
_windowserver  9663   1.9  1.7  3297256 144764   ??  Ss   Fri06PM  16:48.69 /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/WindowServer -daemon

Source

Convert plist files between XML and binary (bplist)

To convert a binary .plist file to XML format for editing, type this in the Terminal:

plutil -convert xml1 some_file.plist

To convert an XML .plist file to binary for use:

plutil -convert binary1 some_other_file.plist

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment