Sponsored Content
Full Discussion: tar
Top Forums UNIX for Dummies Questions & Answers tar Post 6934 by rwb1959 on Sunday 16th of September 2001 10:03:03 AM
Old 09-16-2001
Using tar...

1) use the -t and -v options and it will report a
list of all files on the tape and the total
number of blocks used. You will have to
translate that into bytes base on the block
size.

2) use the -x option to extract files from tape.
If you name the specific directory you are
interested in extracting, you should get all
the files under that particular directory.

Read through the man page carefully for your
specific "tar" (they are pretty much all the same
but some have minor differences).
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Does tar do crc checking on a tape or tar file?

Trying to answer a question about whether tar table-of-contents is a good tool for verifying tape data. (1 Reply)
Discussion started by: tjlst15
1 Replies

2. UNIX for Advanced & Expert Users

Tar utility (untar a .tar file) on VxWorks

Hi All Can someone pls guide me if there any utility to compress file on windows & uncompress on vxworks I tried as - - compressed some folders on windows ... i created .tar ( to maintain directory structure ) and compressed to .gz format. - on VxWorks i have uncompressed it to .tar... (1 Reply)
Discussion started by: uday_01
1 Replies

3. UNIX for Advanced & Expert Users

How to create a Tar of multiple Files in Unix and FTP the tar to Windows.

Hi, On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files. a) /usr/users/oracle/bin b) /usr/users/oracle... (1 Reply)
Discussion started by: marconi
1 Replies

4. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

5. Shell Programming and Scripting

tar command dont tar to original directory

HI, if I have a tarfile called pmapdata.tar that contains tar -tvf pmapdata.tar -rw-r--r-- 0/0 21 Oct 15 11:00 2009 /var/tmp/pmapdata/pmap4628.txt -rw-r--r-- 0/0 21 Oct 14 20:00 2009 /var/tmp/pmapdata/pmap23752.txt -rw-r--r-- 0/0 1625 Oct 13 20:00 2009... (1 Reply)
Discussion started by: borderblaster
1 Replies

6. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

7. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

8. AIX

Making Tar of directory and tar file is going to be placed

Quick question, is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?) sample: /opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz will the tar file backup.tgz also include backup.tgz ? i tried... (5 Replies)
Discussion started by: filosophizer
5 Replies

9. AIX

Tar - pre-checking before making the Tar file

Coming from this thread, just wondering if there is an option to check if the Tar of the files/directory will be without any file-errors without actually making the tar. Scenario: Let's say you have a directory of 20GB, but you don't have the space to make Tar file at the moment, and you want... (14 Replies)
Discussion started by: filosophizer
14 Replies
tar(4)							     Kernel Interfaces Manual							    tar(4)

NAME
tar, pax - Archive file format DESCRIPTION
The cpio, pax, and tar commands dump several files into one, in a medium suitable for transportation. This file is often referred to as a tar file, or tar tape, since it was originally designed to be on an archive tape. An archive file is a series of blocks, with each block of size TBLOCK. A file on the archive is represented by a header block which describes the file, followed by zero or more blocks which give the contents of the file. At the end of the tape are two blocks filled with binary zeros, as an end-of-file indicator. The blocks are grouped for physical I/O operations. Each group of n blocks (where n is set by the b keyletter on the tar command line, with a default of 20 blocks) is written with a single system call. On nine-track tapes, the result of this write is a single tape record. The last group is always written at the full size, so blocks after the two zero blocks contain random data. On reading, the specified or default group size is used for the first read, but if that read returns less than a full tape block, the reduced block size is used for further reads. The header block looks like: ------------------------------------- Field Name Offset Length ------------------------------------- name 0 100 mode 100 8 uid 108 8 gid 116 8 size 124 12 mtime 136 12 chksum 148 8 typeflag 156 1 linkname 157 100 magic 257 6 version 263 2 uname 265 32 gname 297 32 devmajor 329 8 devminor 337 8 prefix 345 155 ------------------------------------- The name field is the name of the file, as specified on the command line. Files dumped because they were in a directory that was named on the command line have the directory name as prefix and /filename as suffix. The mode field is the file mode, with the top bit masked off. The uid and gid fields are the user id and group id numbers that own the file. The size field is the size of the file in bytes. Links and symbolic links are dumped with this field specified as zero. The mtime field is the modification time of the file at the time it was dumped. The chksum field is an octal ASCII value which represents the sum of all the bytes in the header block. When calculating the checksum, the chksum field is treated as if it were all blanks. The typeflag field identifies the type of data following the header. Valid values are: A Global Extended Header follows. An Extended Header follows. Archive data follows. The Global Extended Header and Extended Header formats are only produced when the tar command is used with the -E option, or the pax com- mand is used with the -x xtar option. The linkname field is the name of the file that this file is linked to, if any. If this field is empty, the file is not linked. The first time a given i-node number is dumped, it is dumped as a regular file. Subsequently, it is dumped as a link instead. Upon retrieval, if a link entry is retrieved but the file it was linked to is not, an error message is printed and the tape must be rescanned manually to retrieve the file that it is linked to. The magic field is the magic number for the file type as described in the magic(4) reference page. The version field is always 00 (zero-zero). The uname and gname fields are the user name and group names that own the file. The devmajor and devminor fields are the device major and minor numbers as described in the mknod(8) reference page. The name, linkname, and prefix fields are null-terminated strings, except when all characters in the field are non-null characters. The typeflag field is a single character. The other fields are zero-filled octal numbers in ASCII format terminated by a null character. Unused fields of the header are binary zeros (and are included in the checksum). NOTES
The encoding of the header is designed to be portable across platforms. If filenames are chosen that use characters not in the portable filename character set, results are unpredictable. EXAMPLES
The layout of an archive with a Global Extended Header, two data files, and the end of archive is shown here. ----------------------------------- ustar Header (typeflag=g) Global Extended Header Data ----------------------------------- ustar Header (typeflag=x) Extended Header Data ustar Header (typeflag=0) Data for File 1 ----------------------------------- ustar Header (typeflag=0) Data for File 2 ----------------------------------- ustar Header (typeflag=0) Data for File n ----------------------------------- Block of binary zeroes ----------------------------------- Block of binary zeroes ----------------------------------- RELATED INFORMATION
Commands: cpio(1), mknod(8), pax(1), tar(1) Files: magic(4) delim off tar(4)
All times are GMT -4. The time now is 04:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy