LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-04-2009, 03:25 AM   #1
bsaheb
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Rep: Reputation: 0
Unhappy help required with the tar command


hi,

the issue seems strange, as i was not able to get the solution online i am posting this in forum.

Original tar command:
tar -cvf <destination> <source>

Performed the tar command as follows:
"sample" is the file which i have to tar, but i have given the command by interchanging the source and destination.

tar -cvf sample sample.tar

so this has created a new dummy "sample" file by removing the old one.

can any one please reply me how to restore the original data.

Thanks,
bsaheb
 
Old 11-04-2009, 03:52 AM   #2
indiajoe
Member
 
Registered: Jan 2009
Location: India
Distribution: Porteus atma
Posts: 84

Rep: Reputation: 21
untar twice

Hi,
if you tried to tar a file which didn't exist, then nothing is overwritten it will only say an error. But if, what you mean is that, you first properly tared it and then made the wrong command, just untar twice
Code:
tar -xvf sample
tar -xvf sample.tar
First command will create sample.tar .
Second command will give back the original file.
-Cheers
indiajoe

Last edited by indiajoe; 11-04-2009 at 03:56 AM.
 
Old 11-13-2009, 09:34 AM   #3
emam_shaikh
LQ Newbie
 
Registered: Sep 2009
Posts: 1

Rep: Reputation: 0
how to write .tar command code in Linux?
plz. give me information about this.
 
Old 11-13-2009, 09:47 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by emam_shaikh View Post
how to write .tar command code in Linux?
plz. give me information about this.
This thread already has good examples!!

Have you read the man page? ("man tar" in a terminal)

Homework?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
where is TAR ? bash: tar: command not found Juicyapple Linux - Newbie 7 06-10-2009 09:32 AM
tar-command not found while compiling glibc-libidn-2.7.tar.bz2 of lfs6.3 aditya_gpch Linux From Scratch 1 05-14-2008 12:27 AM
Help required reg .tar extension srikanthweb Linux - General 10 09-08-2007 10:17 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM


All times are GMT -5. The time now is 08:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration