TAR - vybalení adresáře do konkrétního adresáře

Jigdo

  • *****
  • 506
    • Zobrazit profil
TAR - vybalení adresáře do konkrétního adresáře
« kdy: 04. 08. 2022, 21:27:35 »
Neporadi nekdo kde delam chybu?

Kód: [Vybrat]
cd ~/Install;
curl --doh-url https://odvr.nic.cz/doh -kLO https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-20220708.tar.gz
curl --doh-url https://odvr.nic.cz/doh -kLO https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-

Tady vsechno funguje,
ale kdyz se pokusim vybalit z archivu "linux-firmware-20220708.tar.gz" a adresare "linux-firmware-20220708/*.*" vsechno do adresare /lib/firmware/  tak to proste nefunguje

Kód: [Vybrat]
sudo tar -xzf linux-firmware-20220708.tar.gz --wildcards linux-firmware-20220708/*.* --directory=/lib/firmware/ --verbose

koukal jsem do man tar, ale nic jsem tam nenasel

Kód: [Vybrat]
       -x, --extract, --get
              Extract files from an archive.  Arguments are optional.  When given, they specify names of the archive members to be extracted.

       -z, --gzip, --gunzip, --ungzip
              Filter the archive through gzip(1).

       -f, --file=ARCHIVE
              Use archive file or device ARCHIVE.  If this option is not given, tar will first examine the environment variable `TAPE'.  If it is set, its value will be used as the archive name.  Otherwise, tar will assume the compiled-in default.  The default value can be  in‐
              spected either using the --show-defaults option, or at the end of the tar --help output.

       -C, --directory=DIR
              Change to DIR before performing any operations.  This option is order-sensitive, i.e. it affects all options that follow.

       --wildcards
              Use wildcards (default for exclusion).

       --wildcards-match-slash
              Wildcards match / (default for exclusion).

       -v, --verbose
              Verbosely  list files processed.  Each instance of this option on the command line increases the verbosity level by one.  The maximum verbosity level is 3.  For a detailed discussion of how various verbosity levels affect tar's output, please refer to GNU Tar Man‐
              ual, subsection 2.5.1 "The --verbose Option".
« Poslední změna: 05. 08. 2022, 08:37:09 od Petr Krčmář »


k3dAR

  • *****
  • 3 088
  • porad nemam telo, ale uz mam hlavu... nobody
    • Zobrazit profil
    • E-mail
Re:TAR - vybaleni specifickeho adresare do specifickeho adresare
« Odpověď #1 kdy: 05. 08. 2022, 00:57:07 »
v tvuj syntax:
Kód: [Vybrat]
tar -xf linux-firmware-20220708.tar.gz --strip-components=1 --directory=/lib/firmware --verbose-z netreba uvadet, tar sam pozna zda je v gz, xz atd... a zaroven kdyz bys pak misto v gz stahl fw v xz tak bys musel myslet na zmenu "z" na "J" ;-)

nebo jinak:
Kód: [Vybrat]
tar --verbose --directory=/lib/firmware --extract --file=linux-firmware-20220708.tar.gz --strip-components=1 linux-firmware-20220708
viz "man tar"
Citace
      --strip-components=NUMBER
              Strip NUMBER leading components from file names on extraction.

Jigdo

  • *****
  • 506
    • Zobrazit profil
[SOLVED] Re:TAR - vybaleni specifickeho adresare do specifickeho adresare
« Odpověď #2 kdy: 05. 08. 2022, 09:02:12 »
v tvuj syntax:
Kód: [Vybrat]
tar -xf linux-firmware-20220708.tar.gz --strip-components=1 --directory=/lib/firmware --verbose-z netreba uvadet, tar sam pozna zda je v gz, xz atd... a zaroven kdyz bys pak misto v gz stahl fw v xz tak bys musel myslet na zmenu "z" na "J" ;-)

nebo jinak:
Kód: [Vybrat]
tar --verbose --directory=/lib/firmware --extract --file=linux-firmware-20220708.tar.gz --strip-components=1 linux-firmware-20220708
viz "man tar"
Citace
      --strip-components=NUMBER
              Strip NUMBER leading components from file names on extraction.


Diky, funguje :) Tak to jsem prehledl - "File name transformations"