PDA

View Full Version : how do you untar


dburr10085
2008-02-19, 21:04
sorry for the dumb question

brendan
2008-02-19, 21:06
tar -xvf /path/to/your/file.tar

or

tar -zxvf /path/to/your/file.tar.gz

linux_author
2008-02-19, 21:55
before you untar an archive, take a look:

tar tvzf archive_name.tgz | more

or if bzip'd:

tar tvjf archive_name.tar.bz2 | more

(dunno if bzip is built into busybox - where's the busybox man page for the nokia internet tablet? answer: NO DOCUMENTATION)

free
2008-02-19, 23:35
and never untar as root!!

TA-t3
2008-02-20, 11:45
The initial '-' is optional in tar.
So 'tar xvf file.tar' is the same as 'tar -xvf file.tar'.

'x' -> extract
'v' -> verbose (i.e. list the files as they are extracted. Without it it's silent.)
'f''<name> -> name of file to extract from (unpack)
't' -> list content (tv -> list verbose)
'z' -> the tar file is compressed with gzip (e.g. .tar.gz, .tgz)
'j' -> the tar file is compressed with bzip2 (e.g. .tar.bz2)
'c' -> create (make) a tar archive: tar cvf newtarfile.tar <list of files to archive, or directory name etc.>
(Add z or j if you want it compressed as you go along.)

Note that there are some pecularities in tar's option handling: If you specify two or more parameters that take an argument, e.g. 'b' (block size) and 'f' (file/device name), then the arguments are listed together at the end: tar tbf 20 file.tar

The busybox version of 'tar' on the N800/N810/770 is rather limited, it doesn't have that 'b' option for example. More important, it doesn't have built-in help. If you install GNU tar then just enter 'tar --help' to see the options.

speedmartini
2008-02-27, 01:06
Busybox will not accept "j". I am trying to unpack a bzip2 file using the command xvjf or xjf, and I also tried the above method "tvjf" to view the .tar.bz2 file. In every case Busybox is telling me that "j" is an invalid option. What am I doing wrong? Also, if I try bunzip2 from root -though the file extension is .tar.bz2 - busybox tells me it is not a bzip2 file! This is an attempt to utilize the dictionary files available for mDictionary. FYI this is on an N800 - I started off in Troubleshooting and ended up over here by searching for a relevant thread.

speedmartini
2008-02-27, 06:19
Update - Bad File! Good heavens, I wasted about 4 hours trying to figure out what the heck I was doing wrong. Downloaded another dictionary file from Stardict, utililzed bunzip2 in the command line, and then extracted the resulting .tar file just fine!

TA-t3
2008-02-27, 11:59
Busybox will not accept "j". I am trying to unpack a bzip2 file using the command xvjf or xjf, and I also tried the above method "tvjf" to view the .tar.bz2 file. In every case Busybox is telling me that "j" is an invalid option. What am I doing wrong? Also, if I try bunzip2 from root -though the file extension is .tar.bz2 - busybox tells me it is not a bzip2 file! This is an attempt to utilize the dictionary files available for mDictionary. FYI this is on an N800 - I started off in Troubleshooting and ended up over here by searching for a relevant thread.

Most, if not all, non-GNU tar programs won't understand 'j', and some (not including busybox) won't understand 'z' either. The fix is to do as follows instead:

bunzip2 -c file.tar.bz2 | tar tvf -
(to view)
or
bunzip2 -c file.tar.bz2 | tar xvf -
(to unpack)

Ditto for 'z':
gunzip -c file.tar.gz | tar tvf -

(I'm so used to working on non-GNU systems that I usually do the above out of habit even when on a GNU system)

qole
2008-06-24, 16:34
I'm trying to figure out what comes "stock" on an OS2008 N8x0.

I have a tarball that I want to release to the general tablet-owning public.

Obviously, GNU tar does not come "stock", so I can't tell people to "tar xjvf", but it seems that I could gzip my archive and tell people to "tar xzvf" instead.

Can I have some confirmation that bunzip2 comes on a stock N8x0? I could make a little script that does TA-t3's suggested command line, if I can count on bunzip2 being there.

qwerty12
2008-06-24, 16:36
Newly flashed N800 to latest Diablo image:

~ $ bunzip2
-sh: bunzip2: not found

qole
2008-06-24, 18:06
and never untar as root!!

...unless you need to?