Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
7 years, 9 months ago
Can we instruct tar to do not keep modified time of the files in archive file while compress.
What I want is, the extracted directories/files should get time from machine where it's extracting, not from the archive file.
But I want to get it done in compression part, not in extraction part with -m.
Sep 3, 2015 at 21:21
tar always stores the modification time of the files it puts into the archive.
If you like to get the current time of extraction while extracting the archive, the only way to achieve this is to use
tar xm < xxx.tar
at extraction time.
Sep 4, 2015 at 12:51
18.6k 5 5 gold badges 34 34 silver badges 59 59 bronze badges
log in to answer this question.
Not the answer you're looking for? Browse other questions tagged
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only
--mtimeto force the stored mtimes to a specific value. I don't think there's an option to avoid storing it altogether.
tarhas no option
--mtimeIf you refer to vendor specific options, you should mention which vendor specific implementation you refer to.