LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 02: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, 02: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 02:56 AM.
 
Old 11-13-2009, 08: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, 08:47 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:43 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