Skip to content

Instantly share code, notes, and snippets.

@vaibhaw
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save vaibhaw/dfd7ba98ccf2f46ede43 to your computer and use it in GitHub Desktop.

Select an option

Save vaibhaw/dfd7ba98ccf2f46ede43 to your computer and use it in GitHub Desktop.
Linux Utilities
## recursive search only in specific filetypes
grep -nr --include=<pattern> <string> <directory>
# grep -nr -i --include *.{cpp,hpp,java} "isequal" .
# grep -nr -i --include *.cpp --include *.hpp "isequal" .
## grep seach exact word
grep -r -i /^word$/ .
# Get the CPU
grep 'physical id' /proc/cpuinfo | sort -u
# Get the core
grep 'core id' /proc/cpuinfo | sort -u | wc -l
# Get the threads
grep 'processor' /proc/cpuinfo | sort -u | wc -l
# Get the cpu version
dmidecode -s processor-version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment