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 .
|
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. |
thanq for ur reply ,
but the file file is in some format ,it has been changed and the file z is not created . |
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. |
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. |