Similar to this question and this question I'd like to make a single compressed tar file (files.tar.gz) that contains all the php files in my webroot and all it's subdirectories, maintaining folder structure. My webroot is called 'public_html'.
I have not tried anything yet because I'm not sure where to start. The second question that I linked actually comes pretty close to what I'm looking for, but it makes each found file a separate GZ, if I read it right.
Actually, the monolithic nature of the tar is more important to me than the compression of gzip. I just want to pull this file onto my windows machine where I can search through it with the tools I am used to.
find . -name '*.html' -print | xargs echo
in my own webroot. it prints a single line. Thus example 2 you linked to creates a single file.