tarは古いファイルの内容を解凍した。

tarは古いファイルの内容を解凍した。

agという名前の圧縮ファイルがあり、その内容には名前があり、読み取ったtest.tgzファイルがあるとします。hello.txthello world

。を使用して解凍し、.を読むことがtar -zxfできるようにいくつか修正します。hello.txthello.txt is modified

問題は、元のファイルを解凍しようとすると解凍されたtest.tgzファイルがhello.txt まだ読むhello.txt is modified。解凍されたファイルを読み取れないのはなぜですかhello world

ベストアンサー1

再現できません。

$ cd "$(mktemp --directory)"
$ echo 'hello world' > hello.txt
$ tar -czf test.tgz hello.txt
$ tar -zxf test.tgz
$ echo 'hello world is modified' > hello.txt
$ tar -zxf test.tgz
$ cat hello.txt
hello world

詳細を追加してください。

おすすめ記事