polarbear
polarbear

Reputation: 12945

How to use the tar -I option

I'm trying to tar up all the *.class files only on a Solaris box under a certain directory. Reading the man pages for tar made it seem like the -I option is what I wanted. This is what I've tried from the dir in question:

find . -name "*.class" >> ~/includes.txt
tar cvf ~/classfiles.tar -I ~/includes.txt

From that I get:

tar: Removing leading `/' from member names
/home/myhomedir/includes.txt

And the ~/classfiles.tar files is garbage.

I don't have write permission on the dir where the *.class files are so I need to have the tar written to my home dir. Could someone tell me where I have gone wrong? What tar magic should I use?

Upvotes: 0

Views: 3166

Answers (1)

andy
andy

Reputation: 7018

Check which tar you are running. That message about removing the leading slash is a gtar (GNU tar) message, and the -I option you are trying to use is a Sun tar option (which lives in /bin/tar).

(at least the above is all true on my Solaris machine)

Upvotes: 5

Related Questions