Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

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


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.

Old 11-04-2009, 02:52 AM   #2
Registered: Jan 2009
Location: India
Distribution: Porteus atma
Posts: 84

Rep: Reputation: 21
untar twice

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
tar -xvf sample
tar -xvf sample.tar
First command will create sample.tar .
Second command will give back the original file.

Last edited by indiajoe; 11-04-2009 at 02:56 AM.
Old 11-13-2009, 08:34 AM   #3
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
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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)



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 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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:07 AM.

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