terminal command for 64 bits

is there a command line to know if a given app is 64 bits?
As far as I can see, .plist files do not contain such info.
Thank you.

file command on the executable will do it.

That is what I did, but I guess I’m not able to correctly set it, since I just get: directory:

Carlos-MacBook-Pro:~ carlorubini$ file /Applications/App\ Store.app
/Applications/App Store.app: directory

Am I leaving something obvious out?

@Carlo Rubini — There are several possibilities but off the top of my mind, “file” will give you that info:

[code]$ file /Applications/VLC/VLC\ 1.1.12.app/Contents/MacOS/VLC
/Applications/VLC/VLC 1.1.12.app/Contents/MacOS/VLC: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [i386:Mach-O executable i386]
/Applications/VLC/VLC 1.1.12.app/Contents/MacOS/VLC (for architecture x86_64): Mach-O 64-bit executable x86_64
/Applications/VLC/VLC 1.1.12.app/Contents/MacOS/VLC (for architecture i386): Mach-O executable i386

$ file /Applications/Xojo\ 2019\ Release\ 1/Xojo.app/Contents/MacOS/Xojo
/Applications/Xojo 2019 Release 1/Xojo.app/Contents/MacOS/Xojo: Mach-O 64-bit executable x86_64[/code]

And here is what I get when I drop VCS and Xojo-folder straight from the Applications folder into the Terminal window:

$ file /Applications/VLC.app
/Applications/VLC.app: directory

$ file /Applications/Xojo\ 2019\ Release\ 1
/Applications/Xojo 2019 Release 1: directory

Unless I drop into Terminal the VCS executable located in Contents > MacOS, but even in this case your raw results and mine look different (although --strictly speaking-- enough for my quest).

$ file /Applications/VLC.app/Contents/MacOS/VLC
/Applications/VLC.app/Contents/MacOS/VLC: Mach-O 64-bit executable x86_64

By the way, I’m using
Terminal 2.9.4
on Mojave (10.14.4)

@Carlo Rubini — Well the “.app” object is a container (folder) and not the executable file, which must reside in “Contents/MacOS”. Only the executable file will give you the right results.

You can also determine the Mach-O format by reading the first 4 bytes of the executable (e.g. from Xojo):
CA FE BA BE: it is FAT (nowadays 32/64-bit, but for very old programs, it could also be Intel 32-bits/PPC)
CF FA ED FE: it is 64-bit

It don’t remember for 32-bits but I can search if you are interested

Got it. Thank you.

I’m not particularly interested, but thank you again; very kind of you.

The only part of the returned data from the “file” command output that you need to look for is either “x86_64” or “i386” at the end of the output.

Correct. It contains what I was looking for.