A message for Linux.com registered users: We are in the process of making changes to the Linux forums. From Monday, 8/13/18 at 6:00 PM PT to Tuesday, 8/14/18 at 4:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Tuesday, 8/14/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.

November 22, 2017

tar command create destination directory

Hi guys,

Today I had exam again it was alright but one question I can not find answers on the internet.

When I am extracting a tar file tar is supposed to create destination directory. I could now find any information about it.

Suppose I had a file like backup.tar.gz and I wanted to extract to /home/user/backup which does not exist. I won't be able to use mkdir command to create the directory.

I know if destination exists I can do like.

tar xcfj backup.tar.gz -C /home/user/backup 

 

Thank you.

Click Here!