LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 10-02-2003, 10:11 PM   #1
amigatec
LQ Newbie
 
Registered: Aug 2001
Location: Oklahoma
Distribution: Mandriva 2007
Posts: 25

Rep: Reputation: 15
Question about using bash and tar.


What does the -C / do at the end of the line? Also is their a reason that the zxvf is written as -zxvf?

tar -zxvf patch.tar.gz -C /

I have seen this in a few bash scripts.

Last edited by amigatec; 10-02-2003 at 10:13 PM.
 
Old 10-02-2003, 11:06 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Straight from the man page:

-C, --directory DIR; change to directory DIR
 
Old 10-04-2003, 03:37 AM   #3
activelylazy
LQ Newbie
 
Registered: Sep 2003
Distribution: Red Hat 8
Posts: 25

Rep: Reputation: 15
in general, when you have a question on a command, check the man page (for instance, type "man tar" and hit enter)

Also, here are a couple good resources for linux commands:

Comprehensive:
http://www.oreillynet.com/linux/cmd/

Beginner's guide:
http://www.userlocal.com/helpbasic.php
 
Old 10-04-2003, 04:45 AM   #4
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Also is their a reason that the zxvf is written as -zxvf?

tar -zxvf patch.tar.gz -C /

I have seen this in a few bash scripts.

tar -zvxf patch.tar.gz will work.
tar xzvf patch.tar.gz will work.
tar -zfxv patch.tar.gz will not work. The -f option means that the next item is a filename so f should be the last item in the option list.
 
  


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
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
bash/tar bokini Programming 2 07-30-2005 04:50 PM
Set name of tar file as date using bash otisthegbs Linux - Software 5 12-18-2003 03:34 PM
bash scripting and tar pengStudent Programming 2 11-17-2003 07:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 03:26 AM.

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