Following the instructions here: http://linuxdevcenter.com/pub/a/linux/lpt/20_08.html
I'm aiming to tar up a directory but only want to include .php files from that directory.
Given the aforementioned instructions, I've come up with this command. It creates a file called IncludeTheseFiles which lists all the .php files, then the tar is supposed to do it's job only using the files listed in IncludeTheseFiles
find myProjectDirectory -type f -print | \
egrep '(\.[php]|[Mm]akefile)$' > IncludeTheseFiles
tar cvf myProjectTarName -I IncludeTheseFiles
However, when I run this it doesn't like the I include option?
tar: invalid option -- I
This does the trick, no comparison file needed:
Reading the man page for Gnu tar on my Ubuntu 8.04 system, it says:
It does not reference a
-I
option other than to mention that historically it was used to request bzip compression.You should be able to specify stdin as the source for your filenames. Try: