LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-18-2004, 10:58 PM   #1
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
tar question?


I am playing aroung using the tar command. I do not understand why it is behaving this way. Lets say I use this command.
Code:
tar -czf shane.tar.gz /home/shane
shouldn't this just tar my home directory? Why is it also including home? How would I do it differently so it just tars my home directory?
 
Old 04-18-2004, 11:14 PM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
that command should just tar your home dir. with the full path. add a v in there so you can see what is happening.
 
Old 04-19-2004, 12:59 AM   #3
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
You are specifying an absolute path (beginning with a slash) so tar assumes you want the full path in the archive. If you are in /home, type tar cfvz shanehome.tar.gz shane instead. This will create an archive with the shane directory as root.

Btw, just dropping the hyphen before the flags to tar will make tar ignore the order of the flags, so I recommend using it that way.


Håkan
 
Old 04-19-2004, 08:58 AM   #4
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30
I would like to work from my mounted vfat partition, so I need to specify the whole path. I will eventully want to tar my /usr partition(4gb) and I only have enough room to work from my vfat partition(not enough room in my root).

Last edited by shanenin; 04-19-2004 at 09:37 AM.
 
Old 04-19-2004, 09:11 AM   #5
davec
LQ Newbie
 
Registered: Apr 2004
Location: Dublin, Ireland
Distribution: fedora core 1, redhat 9.0, slackware 9.0
Posts: 22

Rep: Reputation: 15
you don't need to specify the whole path, you can change into directories on your vfat partition same as you would on your linux partition, then you can tar each directory just as hw-tph said you can....
 
Old 04-19-2004, 04:06 PM   #6
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
code:tar -czf shane.tar.gz /home/shane


tar czvpf /path/to/fat/shane.tar.gz -C /home shane

the -C /home means change directories to /home, then tar shane

or maybe this appeals to you more

(cd /home;tar czvpf - shane > /mountpointfat32/shane.tgz)

Last edited by whansard; 04-19-2004 at 04:11 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 10:55 AM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 06:30 AM
tar.gz question <---NOOOOOB QUESTION jairo Linux - Software 4 02-17-2003 05:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration