Skip to content

Instantly share code, notes, and snippets.

@nooitaf
Created August 24, 2016 00:46
Show Gist options
  • Save nooitaf/e885b9358f6a40eb2ce45daa7ce0276c to your computer and use it in GitHub Desktop.
Save nooitaf/e885b9358f6a40eb2ce45daa7ce0276c to your computer and use it in GitHub Desktop.
Linux Cheatsheet
#!/bin/bash
# find something in first line, outputs filepath and file
find . -type f -exec sh -c "if head -n 1 {} | grep 'firrst row text' > /dev/null; then echo {}; cat {}; fi; " \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment