Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I must to run the tar command only under /var/tmp in my Linux machine ( red-hat linux ) so I run the tar command. And directory "KIT" created under /var/tmp in place under /var/tmp/DIR/

What to change in the command in order to create the KIT directory under /var/tmp/DIR/ dir?

        cd /var/tmp
        tar zxvf /var/tmp/DIR/file.tar.gz

under /var/tmp I see

   KIT/
   KIT/STF-5/
   KIT/STF-5/SJ-GENER-363/
   KIT/STF-5/SJ-GENERONS-1.5-0/NYGDE
   KIT/STF-5/SJ-RESOUR-1.5-0/
   KIT/STF-5/SJ-RESAGER-1.5-0/NWERM
   KIT/STF-5/NETSNMP-0/
   KIT/STF-5/NETSNMP-5.3-0/NYNETSNMP

and what I need is to create the KIT under /var/tmp/DIR

share|improve this question

1 Answer 1

up vote 1 down vote accepted
tar zxvf /var/tmp/DIR/file.tar.gz -C /var/tmp/DIR/
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.