LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Thread Tools
Old 03-30-2005, 02:18 AM   #1
gautham
LQ Newbie
 
Registered: Oct 2004
Location: hyderabad
Posts: 2
Thanked: 0
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file


[Log in to get rid of this advertisement]
gave wrong syntax for tar command as tar -cvzf file file.tgz , now the file with filename file was encrypted how to recover it .
gautham is offline     Reply With Quote
Old 03-30-2005, 03:03 AM   #2
gerardt
Member
 
Registered: Feb 2005
Location: South Africa
Distribution: SuSE
Posts: 60
Thanked: 0
Was the above your exact command line?
your original file should be untouched and you should have received an error message. Possibly also a file z with rubbish in it.
gerardt is offline     Reply With Quote
Old 03-30-2005, 03:48 AM   #3
gautham
LQ Newbie
 
Registered: Oct 2004
Location: hyderabad
Posts: 2
Thanked: 0

Original Poster
thanq for ur reply ,
but the file file is in some format ,it has been changed and the file z is not created .
gautham is offline     Reply With Quote
Old 03-30-2005, 04:04 AM   #4
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 12,875
Thanked: 232
I think that your syntax tars an already tarred file "file.tgz" and the name of the created tarfile is "file". So the original contents of file were overwritten. However if the file.tgz didn't exist before the command and you received and error, you might still give "file" a look with the 'file' command. (To may files named 'file' here!)

/bin/file file

The 'file' command examines the file for 'magic bytes' to analyze what the file is.

If you haven't rebooted the computer, you could also use the 'lsof' command.

lsof | grep 'file'
or maybe
lsof | grep 'tar'

I doubt if a process still has the original file open, or even that the original file isn't overwritten, but it is worth a shot.

Sometimes there will still be a handle open that you can access by identifying the process that has the file handle reference and access the file through the /proc/<pid>/ directory.

Last edited by jschiwal; 03-30-2005 at 04:10 AM..
jschiwal is offline     Reply With Quote
Old 04-13-2005, 04:15 AM   #5
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Kubuntu Karmic Koala
Posts: 17,463
Blog Entries: 4
Thanked: 87
Moved: This thread is more suitable in Linux-General and has been moved accordingly to help your thread/question get the exposure it deserves.
XavierP is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 10 02-23-2008 06:40 AM
tar.gz to .tgz file? wombat53 Linux - Software 20 06-15-2005 09:31 AM
Quick...Someone Tell Me How To Open a Tar File in .tgz format njschroe Linux - Software 3 06-10-2005 05:58 AM
D/l a .tgz.tar file..how to unzip Navop Linux - Newbie 1 03-13-2005 08:56 AM
tar -cvzf file.xml file.tar.gz RickHunter_Ve Linux - Software 1 10-06-2004 01:58 PM


All times are GMT -5. The time now is 01:32 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration