I took a backup using: cd /usr/CCS

tar cvfz /usr/LARGE/BKUP/hms.tar.gz *

Now I would like to restore HMS and overwrite at /usr/CCS/HMS.

HMS is one of the subfolders under /usr/CCS

Can I get some help in restoring only the HMS folder from the tar and overwriting it at /usr/CCS/HMS.


You could try this: tar -xvf /usr/LARGE/BKUP/hms.tar.gz -C /usr/CCS HMS

/usr/LARGE/BKUP/hms.tar.gz - is your backup

-C /usr/CCS - where tar should enter, to start extracting

HMS - which files/directorys it should extract from backup (path relative to archived files)

| improve this answer | |
  • Thanks, which directory should I cd first.will this work in redhat. – Muhammad Apr 27 '14 at 14:30
  • Directory is irrelevant. -C tells tar where to cd – Artur Szymczak Apr 27 '14 at 14:32
  • Worked perfectly. Thank you very much Artur. – Muhammad Apr 27 '14 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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