tar -C option at the file system
Here's the syntax I used to untar a particular folder to a directory in the file system:
"tar -C / -tvf /dev/nst0 /media/videos" Instead of getting a result that the files were written on the file system (because of the '/'), it stores the untarred files to the directory where I issued the command. How can you untar your file to the file system? |
Your command doesn't extract files, it lists the contents of the tar archive.
|
its simple
#tar -xzvf name.tar.gz this will untar in current directory if you want to untar it in another location #tar -xzvf name.tar.gx /path/to/directory actually option "c" using for compress the files and "t" for list the contents inside the tar file check manpage for more information |
-C means change working directory (to / in this case). But why do that if you want to tar /media/videos?
If you want to tar /media/videos you can omit -C / However as jschiwal pointed out, -tvf lists the contents. For creating a tar file, use -cvf Also you are writing to a tape device which does not rewind at the end of the write operation. Is that intentional? jlinkels |
as well as this with tar be aware the the - does change how the parameters work. see the man page.
|
tar -C option in the file system
Thanks for all your reply. I'm trying to extract files from the tape and would want to place the extracted files to the file system. With your replies, here's the new syntax:
tar -C / -xvpf /dev/nst0 /media/videos Now the syntax works well! I think it really is with where you place the options before executing the desired command. |
All times are GMT -5. The time now is 04:45 PM. |