B
B
beduin012017-10-13 21:12:24
linux
beduin01, 2017-10-13 21:12:24

How to unpack an archive without creating an additional nesting level?

There is a directory called Project1 with the following content (file and directory):
config.ini
sources\
There is a utility that archives it. The output is a file:
latest.tar.gz
If you open it, it will contain the `latest` folder. And it already has a config and a sources folder. How can I unpack it so that it overwrites the original files? It's just that if I extract it, the `latest` directory will be created in the target folder and everything else is already in it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Moseychuk, 2017-10-14
@beduin01

tar --strip-components=1 -xf latest.tar.gz

T
TyzhSysAdmin, 2017-10-13
@POS_troi

Well, pack it without the latest directory, but only inside it
(note the dot)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question