90

With the usage of wget command line I got a tar.gz file. I downloaded it in the root@raspberrypi. Is there any way to uncompress it in the /usr/src folder?

Paulo Boaventura
  • 1,365
  • 1
  • 9
  • 29
dali1985
  • 3,263
  • 13
  • 49
  • 68

3 Answers3

152

Use -C option of tar:

tar zxvf <yourfile>.tar.gz -C /usr/src/

and then, the content of the tar should be in:

/usr/src/<yourfile>
qingchen
  • 1,706
  • 1
  • 11
  • 3
  • 14
    -z : filter the archive through gzip • -x : extract files from an archive • -v : verbosely list files processed • -f : use archive file or device F (default "-", meaning stdin/stdout) • See http://linuxcommand.org/man_pages/tar1.html – Dane Rossenrode May 21 '17 at 08:07
25

Try this:

tar -zxvf file.tar.gz
dratewka
  • 2,104
  • 14
  • 15
13
gunzip <filename>

then

tar -xvf <tar-file-name>
Spudley
  • 166,037
  • 39
  • 233
  • 307
Satya
  • 8,693
  • 5
  • 34
  • 55