LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux 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
 
Search this Thread
Old 03-30-2005, 01:18 AM   #1
gautham
LQ Newbie
 
Registered: Oct 2004
Location: hyderabad
Posts: 2

Rep: Reputation: 0
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file


gave wrong syntax for tar command as tar -cvzf file file.tgz , now the file with filename file was encrypted how to recover it .
 
Old 03-30-2005, 02:03 AM   #2
gerardt
Member
 
Registered: Feb 2005
Location: South Africa
Distribution: SuSE
Posts: 60

Rep: Reputation: 15
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.
 
Old 03-30-2005, 02:48 AM   #3
gautham
LQ Newbie
 
Registered: Oct 2004
Location: hyderabad
Posts: 2

Original Poster
Rep: Reputation: 0
thanq for ur reply ,
but the file file is in some format ,it has been changed and the file z is not created .
 
Old 03-30-2005, 03:04 AM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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 03:10 AM.
 
Old 04-13-2005, 03:15 AM   #5
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,174
Blog Entries: 4

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Moved: This thread is more suitable in Linux-General and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


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


All times are GMT -5. The time now is 09:12 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration