0
我有一個包含同一文件的不同版本的tar文件,如何提取文件的先前版本(不是最後一個版本)之一?提取存儲在tar歸檔文件中的以前版本的文件
這裏是如何創建一個測試tar文件:
創建一個測試目錄
[email protected]:~/tmp$ mkdir test
創建一個測試文件
[email protected]:~/tmp$ echo line 1 > test/test.txt
創建焦油包含測試的文件文件
[email protected]:~/tmp$ tar -cvf test.tar test/*
回報
test/test.txt
更改
[email protected]:~/tmp$ tar -dvf test.tar test/*
回報(沒有評分)
012檢查變化的測試文件
[email protected]:~/tmp$ echo line 2 >> test/test.txt
檢查更改
[email protected]:~/tmp$ tar -dvf test.tar test/*
回報(魔術:該文件已更改)
test/test.txt
test/test.txt: Mod time differs
test/test.txt: Size differs
更新tar文件
[email protected]:~/tmp$ tar -uvf test.tar test/*
回報
test/test.txt
更改
[email protected]:~/tmp$ tar -dvf test.tar test/*
返回檢查(兩個版本存在)
test/test.txt
test/test.txt: Mod time differs
test/test.txt: Size differs
test/test.txt
謝謝, 塔爾