Skip to content

Instantly share code, notes, and snippets.

@btbytes
Created September 24, 2010 16:32
Show Gist options
  • Select an option

  • Save btbytes/595637 to your computer and use it in GitHub Desktop.

Select an option

Save btbytes/595637 to your computer and use it in GitHub Desktop.
find ~/htdocs | grep html$ | xargs grep -l "<pre syntax=" | xargs -I {} -t ./hyperpyg.py -f {} -o {} -q
@goosemo
Copy link
Copy Markdown

goosemo commented Sep 27, 2010

find ~/htdocs -type f -name *.html -exec grep -l "<pre syntax=" {} ; | xargs -I {} -t ./hyperpyg.py -f {} -o {} -q

@btbytes
Copy link
Copy Markdown
Author

btbytes commented Sep 27, 2010

while that uses less processes, it is longer to type ;)

I agree, I'm still learning the full use of find.

@goosemo
Copy link
Copy Markdown

goosemo commented Sep 27, 2010

Yeah it's an awesome tool, you might find though that putting all the work on find, will make the chain faster too. For instance the -type f makes it so no dir/links show in the output, and -name does simple ls/cd like regex (though there is a -regex flag). All of those and the -atime -perm type flags combine to make find pretty awesome, and only something I've lately become more familiar with.

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