How to check if my software is 32-bit or 64-bit

I want to check if my software is 64 bit or 32 bit (not the OS). This software is an executable file, and when I check it, no information is given if it is 64-bit or 32-bit.

How do I check if my software is 64-bit or 32-bit?

0

2 Answers

You can use the file command to check out what format has that executable. For example:

file /usr/bin/gedit
/usr/bin/gedit: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x5a388215eb6f60b420fc3b6d68ec52d563071f84, stripped
0

This simple command will show you whether the executable file is 32 bit(i386) or 64 bit(amd64) .

Syntax:

apt-cache show $(dpkg -S /path/to/the/file | awk -F ':' '{print $1 }') | awk '/Architecture:/ {print $2}' -

Example:

$ apt-cache show $(dpkg -S /usr/bin/gedit | awk -F ':' '{print $1 }') | awk '/Architecture:/ {print $2}' -
amd64

Explanation:

dpkg -S command grabs the package in which the file actually belongs to.apt-cache show package command will shows the details about the package.From that details, awk grabs only the Architecture part and redirects it to stdout.

OR

You can try this command also,

$ dpkg -l $(dpkg -S /usr/bin/gedit | awk -F ':' '{print $1 }') | awk '/ii/ {print $4}'
amd64
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like