13
2
In the section "Installing Portage", the Gentoo installation docs say:
# tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr
What does this command do?
13
2
In the section "Installing Portage", the Gentoo installation docs say:
# tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr
What does this command do?
21
Tar is used to handle archives (historically saved on tapes).
x
tells it to extract files from the archivev
stands for verbosej
for bzip2 archivef
indicates the file nameC
tells it to change directory (so the package content will be unpacked there)See also man tar
.
10
If you ever need to know what a parameter does again, try to read the man first. The command man tar
, and then doing /-C
will get you to the section describing what -C stands for, which in this example represents 'change directory' (i.e. sends the results of the unpacking to /mnt/gentoo/usr
).
4
It unpacks /mnt/gentoo/portage-latest.tar.bz2
in /mnt/gentoo/usr/
I've also seen -C used while creating an archive. What does it mean in that context? – frakman1 – 2020-01-23T21:51:21.217
@frakman1: Do I really have to copy the contents of
man tar
here? – choroba – 2020-01-23T22:11:53.247The man page just says
change to directory DIR
which is not very helpful. Saying "(so the package content will be unpacked there)" on the other hand, is. – frakman1 – 2020-01-23T22:19:13.317OK. When -C is used while creating an archive, it specifies where to search for the files to archive. – choroba – 2020-01-24T09:58:02.570