LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file (https://www.linuxquestions.org/questions/linux-general-1/gave-wrong-syntax-for-tar-as-tar-cvzf-file-file-tgz-how-to-recover-the-file-307651/)

gautham 03-30-2005 01:18 AM

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 .

gerardt 03-30-2005 02:03 AM

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.

gautham 03-30-2005 02:48 AM

thanq for ur reply ,
but the file file is in some format ,it has been changed and the file z is not created .

jschiwal 03-30-2005 03:04 AM

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.

XavierP 04-13-2005 03:15 AM

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


All times are GMT -5. The time now is 06:46 AM.