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.

  • 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 Ward 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

.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. :)

  • file my_file.bakcommand gave just data – mico Jul 11 '11 at 14:36
  • 11
    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

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.

  • 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 Ward Jul 11 '11 at 14:42

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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