Skip to content

Instantly share code, notes, and snippets.

@cabrinha
Created June 27, 2015 23:12
Show Gist options
  • Save cabrinha/f43809f36a348b2dcf1e to your computer and use it in GitHub Desktop.
Save cabrinha/f43809f36a348b2dcf1e to your computer and use it in GitHub Desktop.
I'd rather awk than grep awk...
#!/bin/bash
# You could grep root | awk {print $1}
ps aux | grep root | awk '{print $1]'
# Or you could do away with the grep entirely
ps aux | awk '/root/ {print $1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment