Extracting individual Files via tar

parv parv at pair.com
Thu Nov 6 14:47:51 PST 2003


in message <200311062200.hA6M0uLH074820 at dc.cis.okstate.edu>,
wrote Martin McCormick thusly...
>
> 	The command
> 
> tar ztf  /usr/local/src/ports.tar.gz
> 
> produces a table of contents just like the man page says it should.
> The man page also says that individual files can be recovered or
> listed but I haven't gotten that to work at all. if I try:
> 
> $ tar zt ports/print/pstotext/ /usr/local/src/ports.tar.gz
> 
> tar (child): /dev/sa0: Cannot open: Permission denied
> tar (child): Error is not recoverable: exiting now

You forgot the bit about default file...

  -f [hostname:]file
  --file [hostname:]file  Read or write the specified file (default is
                          /dev/sa0).  If a hostname is specified, tar
                          will use rmt(8) to read or write the
                          specified file on a remote machine.  ``-''
                          may be used as a file- name, for reading or
                          writing to/from stdin/stdout.


...try this instead...

  tar zxf /usr/local/src/ports.tar.gz  ports/print/pstotext/


  - Parv

-- 



More information about the freebsd-questions mailing list