Wednesday, 22 October 2014

Mac OS X - Want to know what file-type something is ?

I found a file in a folder: -

ls -al a

-rw-r--r--@ 1 hayd  staff  414720 20 Aug 18:41 a

No idea what it is, I tried renaming it to .PDF, .DOC, .TXT etc. but neither Finder, TextEdit, vi nor OpenOffice would open it.

Then I remembered ....

Mac OS X is just like Unix, in fact it IS Unix.

And we have the file command: -

file a

a: CDF V2 Document, Little Endian, Os: Windows, Version 6.1, Code page: 1252, Author: Bob Slobb, Template: C:\Program Files\Microsoft Office\Visio11\1033\FOOBAR.VST, Name of Creating Application: Microsoft Visio

at which point, all becomes clear. It's a Visio drawing, which I can open in OmniGraffle.

A swift rename later: -

mv a a.vsd

and we're up and running.

Remember, folks, file is your friend

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...