Ubuntu – How to open a .bak file on Linux

filesfilesystemslinuxUbuntu

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.

Best Answer

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

Related Question