- How to run an .exe from linux command prompt
- Executes Under Windows
- Execute Under Linux
- Executing a Linux executable on Linux
- Executing a Windows executable on Linux
- Open/read Unix Executable file [closed]
- 2 Answers 2
- RPM-Based Linuxes (RHEL, Fedora, CentOS. )
- DEB-Based Linuxes (Debian, Ubuntu, Mint. )
- Mac OS X
- FreeBSD
- How to run exe file in Ubuntu [duplicate]
- 2 Answers 2
How to run an .exe from linux command prompt
but if it’s really a Windows program, you will need to install «wine», then do:
but only some Windows programs will work under wine.
This anwswer is combining other answers in to this question into one.
The info.exe file will either execute under Linux or Windows, but not both.
Executes Under Windows
If the file is a windows file, it will not run under Linux on it’s own. So if that’s the case, you could try running it under a windows emulator (WINE). If it’s not compatible with wine, then you won’t be able to execute it under Linux.
Before you can start, you will need to install wine. The steps you need to install wine will vary on the linux platform you are on. You can probably google «Ubuntu install wine», if for example, you’re installing ubuntu.
Once you have wine installed, then you’d be able to execute these commands.
Execute Under Linux
if you know this file to run under linux, then you’ll want to execute these commands:
Change to your abc directory
Then you’ll want to change permissions to allow all users to execute this file (a+x).
you could also allow just the user to execute (u+x)
Launch the program, the ./ tells the command line to look in the current path for the file to execute (if the ‘current’ directory isn’t in the $PATH environment variable.
«you could try running it under a windows emulator (WINE).» WINE does stand for «Wine Is Not an Emulator».
My comment was meant to be both a joke a a proposition for an edit. AFAIK Wine basically replaces windows calls for POSIX equivalents, so whoever named it was not ironic, that is WINE is indeed not an emulator.
you can’t 🙂 exe is Microsoft only. now if you had a linux executable you could do:
cd folder chmod +x file ./file
This is false in general. Many Windows and DOS EXEs can be run on Linux using emulators such as wine or dosbox .
@Royi probably «yes», but that depends on how simple we’re talking. But wine should also do your trick.
On Linux you give the file executable permissions. It isn’t the extension that determines whether or not it can be executed (as on windows.)
Assuming you have a valid file that can be executed in Linux, (not a windows/dos file) do this:
cd abc chmod a+x info.exe ./info.exe
Note that you need the leading ./ for the shell to find the file in the current directory!
This really belongs on superuser though.
The first line changes the directory, the second line tells linux it is executable, the third runs the program.
I recently wanted to run some old MSDOS .exe files and I could just use dosbox. On Ubuntu it was just
.exes are generally Windows executables, not linux ones. To run those, use something like WINE.
Otherwise, to run a Linux executable, there are many ways, e.g.:
- cd abc; ./info.exe
- ./abc/info.exe
- /full/path/to/abc/info.exe
- Add «abc» to your PATH, then just run it as a normal command.
I struggled so much until I found this website and used the ‘terminal’ tips section at the bottom of the page: winehq.org/download/ubuntu
Wine is a program that you can install, which allows you to run .exe files on linux.
(go to the directory of your file: /cd (ex: Desktop/) And to open your .exe file:
If you have any problems with wine, you can do wine —help .
Here is how to run an executable file in Linux:
- open terminal with ctrl + alt + T : sudo apt-get update
- install Wine: sudo apt-get install wine
- go to the directory in which your .exe file is placed by changing directory: cd /Desktop
- wine filename.exe
Hit enter and your .exe file will be executed.
Executing a Linux executable on Linux
If the executable is a Linux executable, you need to make sure that your shell can find it. Here are some ways how to do that.
But first, make sure it’s executable. You can check whether the x (executable) flag is set using ls -l abc/info.exe and you can set it with chmod +x abc/info.exe .
- Run it with relative path, in your example: abc/info.exe .
- Run it with absolute path, for example: /home/username/abc/info.exe (depends on where it actually is)
- Place the binary in a directory that is part of the PATH that is searched by the shell to find binaries. For example, cp abc/info.exe ~/bin/ . If ~/bin is part of PATH , you can now run info.exe without qualifying it.
- Make the directory that contains the binary part of the PATH , for example, export PATH=~/abc:$PATH . Note that this is for the current shell only, unless you add this line to your .bashrc or .profile
Executing a Windows executable on Linux
If the executable is a Windows executable, you need to install wine . Then you can run it using wine abc/info.exe . If you want to run it like a Linux program, you need to install wine-binfmt . Then you can run it the same way as described above for Linux executables.
If you use Ubuntu, install wine like this:
sudo apt-get install wine wine-binfmt
Open/read Unix Executable file [closed]
Is there a native way (no installing or downloading extra stuff) to read a Unix executable file? I just need to read file to see what’s in it and learn what I can use it for. What I’m really trying to do is learn what the Wireless Diagnostics app does, or rather how it does it. I’m looking to build my own network diagnostics app for my mac. So, I was wanting to read what the Wireless Diagnostics app (location: /System/Library/CoreServices/Applications/Wireless Diagnostics.app) so I found the executable file in the app to see if I could glean anything. That’s what I’m looking to get out of this.
Thanks. That did it. Is there a re better way (even if I have to download something extra) to get output in a readable format? The strings command outputs code mixed up and every word on its line.
objdump will dump an entire program, but I hope you know assembly. gdb is excellent (and if you have source code even better). The way your question reads though you want man pages, but from what you said about @jasonwryan suggests otherwise.
2 Answers 2
If we’re talking about a command you can run at the shell prompt, there should be a manual page:
If you get back something like No manual entry for foo , you can try GNU info instead:
Not all Unix and Unix-like OSes have GNU info on them, but a lot do, and it often gives more information about a given command than the classic man page does.
If you do have info and it doesn’t know about the command, you will get something like No menu item ‘someprogram’ in node ‘(dir)Top’ at the bottom of the screen. Press Q to leave info .
Programs are often owned by some package manager on such systems, and you can also ask the package manager about the program. For the sake of example, we will say that you are interested in someprogram , and you’re using a shell with the which command. If the latter isn’t available, you can give the path to the executable manually, like /usr/bin/someprogram .
RPM-Based Linuxes (RHEL, Fedora, CentOS. )
First find out which package the program belongs to:
$ rpm -qf `which someprogram` somepackage-1.2.3-4
Then ask RPM about the package:
$ rpm -qi somepackage Name : somepackage Version : 1.2.3 Release : 4 . etc.
DEB-Based Linuxes (Debian, Ubuntu, Mint. )
The pattern is the same as for RPM. First, find out who owns the file:
$ dpkg -S `which someprogram` somepackage: /usr/bin/someprogram
Then ask about the package itself:
$ dpkg -s somepackage Package: somepackage Essential: no Status: install ok installed . etc.
Mac OS X
The «native» OS X package manager is somewhat of a hidden OS feature, and it isn’t used for everything, but it’s worth a try. The pattern is the same as above:
$ pkgutil --file-info `which someprogram` volume: / path: /usr/bin/someprogram pkgid: com.example.bundles.somepackage pkg-version: 1.2.3 . etc.
Then to get more info about somepackage :
$ pkgutil --pkg-info com.example.bundles.somepackage $ pkgutil --files com.example.bundles.somepackage . etc.
If you have installed one of the third-party package managers (Homebrew, MacPorts, or Fink) there are similar commands to get information about packages they own.
If you’re dealing with a program installed outside any of these systems, you’re probably dealing with a GUI program that is happy to tell you all about itself using internal mechanisms. (About box, Help, etc.)
FreeBSD
Classically, the BSDs haven’t used formal package managers, but over the past several years, FreeBSD has been slowly moving toward the use of pkg , a.k.a. PkgNG.
It, too, shares the same usage pattern as the above systems:
$ pkg which `which someprogram` /usr/bin/someprogram was installed by package somepackage-1.2.3-4 $ pkg info somepackage somepackage-1.2.3-4 Name : somepackage Version : 1.2.3-4 . etc.
Perhaps someday the vast majority of programs installed on a FreeBSD box will be installed via pkg , but not today.
If you have a program installed via Ports, and you can figure out which Port installed it, you can probably get what you want with this:
$ cd /usr/ports $ ls -d */somepackage net/somepackage $ cat net/somepackage/pkg-descr
How to run exe file in Ubuntu [duplicate]
If the .exe file is a windows executeable, you can’t run it directly in Ubuntu (or other Linux’s). Either you should install Wine and run it through that, or find a utility in Ubuntu that does the same as the windows one.
Could be a slight case of the XY-problem (meta.stackexchange.com/questions/66377/what-is-the-xy-problem). If you want to convert a wav-file to raw PCM data for processing in Matlab, you could use a linux-tool like sox instead: stackoverflow.com/questions/9383576/…
Is WAV2RAW.exe the only EXE program you want to run, or do you have several other DOS / Windows / .NET programs?
I’m relatively sure that Matlab (and its open-source clone Octave) have native functions to parse WAVE headers and data as well as to write raw PCM data since I used them in the past. Those would obviate the need for an external conversion application unless the PCM data doesn’t fit into main memory.
2 Answers 2
I think you should use Wine.
sudo apt-get install wine wine dir/WAV2RAW.exe
Or Mono if you know that exe is .NET application:
sudo apt install mono-runtime mono dir/WAV2RAW.exe
You don’t need to chmod . Besides that, it’s worth noting that not all software runs under wine. YMMV.
You seem to have added the chmod line according to my comment. However, I think it is only necessary if you want to run the .exe file directly, i.e. without prepending wine to the command line – like OP wants to. I haven’t tested it with Wine but it behaves this way with .NET exe files ( mono my.exe or chmod +x my.exe && ./my.exe ) or even shell scripts ( sh script.sh or chmod +x script.sh && ./script.sh ).
@Melebius that works because Wine registers itself in binfmts when installed from the official Ubuntu package.