Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have received a file of .bak format, let it be foo.bak. I don't know if it is a MS-DOS file or Linux/Unix file. What I know is that I can't open it because my Linux (Ubuntu) does not give any hint how to open it.

So, how I open this file?

Just to omit warnings about not knowing what I am doing:

Disclaimer: I received my file from a known place, it is not a virus. It is a soft copy of one system I should next work on. I just do not happen to know how to open it.

share|improve this question
    
It is most probably not a Linux backup: substituting .bak with .exe did not solve my problem. –  mico Jul 11 '11 at 14:03
    
what do you mean by "soft copy of one system"? –  Marcel G Jul 11 '11 at 14:51
    
I think they mean a backup image of a Windows Operating System –  Thomas W. Jul 11 '11 at 14:56
    
have you any idea (or possibility to find out) with which program this file was initially created? –  Marcel G Jul 11 '11 at 15:33
add comment

3 Answers

up vote 15 down vote accepted

.bak generally designates that the file is a backup copy of something, but other than that it gives preciously little information as to the actual file type.

Try looking at the output of the file command, which studies the first few bits of the file to see if it recognizes it as a known filetype:

caleburn: ~/ >file image001.jpg 
image001.jpg: JPEG image data, JFIF standard 1.01
caleburn: ~/ >file oops.png 
oops.png: PNG image data, 935 x 546, 16-bit/color RGB, non-interlaced
caleburn: ~/ >file zones.zip 
zones.zip: Zip archive data, at least v2.0 to extract
caleburn: ~/ >file eth2.pcap 
eth2.pcap: tcpdump capture file (little-endian) - version 2.4 (Ethernet, capture length 96)

And so on, and so on. Once you know what type of file linux thinks it is, google should be able to suggest how to access it.

... Alternately, you can ask whoever sent it to you what the original filename was supposed to be and find out that way. :)

share|improve this answer
2  
+1: Fast answering :) –  mico Jul 11 '11 at 14:09
    
file my_file.bakcommand gave just data –  mico Jul 11 '11 at 14:36
10  
That means that it doesn't recognize it as any kind of filetype it knows about -- and file knows a /lot/ of filetypes. You can try to extract a little more information about it by typing strings foo.bak | less and scrolling through the output to see if any of it makes sense. Beyond that, I reiterate that asking the person who sent it to you is your best bet. –  Shadur Jul 11 '11 at 18:05
    
I now identified the file. It was not a program but it was a "database dump" of the data stored by that program. Thanks to all you guys! –  mico Jul 12 '11 at 6:49
    
What also helped me on my task about Windows files: wine helps on running them in Linux :) –  mico Jul 12 '11 at 8:09
add comment

A .bak file, as defined at FileInfo.net is a Windows or MacOS backup file. Also according to the site, you should likely open the .bak file with the program that originally created it. Currently, that is dependent on the type of .bak file.

share|improve this answer
    
It became clear this is a Windows file. Can this file then be opened in any way at Linux? –  mico Jul 11 '11 at 14:37
    
To my knowledge, no. Generally speaking, a .bak file needs to be opened with the program that made it. For example, ihatephp.php.bak would need to be opened up by a PHP editor (or notepad/gedit/nano/vim) after removing the .bak part of the file. If the .bak is a Windows System backup, then you cannot open it on linux or ubuntu, as it requires Windows to restore from a backup file that it created. –  Thomas W. Jul 11 '11 at 14:42
add comment

You can open it by change the file extension from .bak to .tgz then open it with Winzard or Winzip application

share|improve this answer
2  
It turned out to be a database dump; I'm not sure why you decided it was a tgz file –  Michael Mrozek Dec 5 '12 at 4:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.