Running executable files on linux

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

Читайте также:  Linux generate qr code

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

  1. cd abc; ./info.exe
  2. ./abc/info.exe
  3. /full/path/to/abc/info.exe
  4. 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:

  1. open terminal with ctrl + alt + T : sudo apt-get update
  2. install Wine: sudo apt-get install wine
  3. go to the directory in which your .exe file is placed by changing directory: cd /Desktop
  4. 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.

Читайте также:  Linux window class name

If you use Ubuntu, install wine like this:

sudo apt-get install wine wine-binfmt 

Источник

How to Execute .bin and .run Files in Ubuntu

How to start bin and run files on Ubuntu

How to start bin and run files on Ubuntu

Before we explain how to run .bin and .run files on your Ubuntu system, let’s first define what exactly these file extensions are:

Bin file: A binary or BIN file in Ubuntu refers to installation packages, which are mostly self-extracting executable files used to install software on your system. You can install most software packages through the Ubuntu Software Manager, such as .deb packages and .tar.xz packages. However, there is software that is not available in these formats. This mainly includes newer software and newer versions of software, usually beta versions, that are not otherwise available. The bin packages are simply run from the Ubuntu command line, the terminal.

Run File: These are also executable files typically used to install Linux programs. Run Files contain program data and instructions for installation; they are often used for distributing device drivers and software applications. Run packages are easily executed from the Ubuntu command line, the terminal.

In this article, we will explain how to run/execute the files with .run and .bin extensions on Ubuntu Linux.

We have run the commands and procedures mentioned in this article on an Ubuntu 22.04 LTS system. We will use the Ubuntu command line, the terminal, to explain how to run bin and run files. You can open the terminal application either by searching in the system application launcher or by pressing Ctrl+Alt+T.

Note: Make sure that your .run and .bin files are from a reliable source, because running an unsafe file can damage your system and even compromise your system security.

Executing .bin and .run files

The process of running both the run and BIN files is pretty simple and straightforward in Ubuntu.

We are assuming that you have already downloaded your bin/run file in a known location on your Ubuntu.

Open the Terminal application and move to the location where you have saved the executable file.

For example, I would use the following command to move to my Downloads folder:

Go to the Downloads folder

Now use the following command to make your .bin/.run file executable:

In this example, I will be making a sample .run file named samplefile.run executable.

If your .run/.bin file does not exist in the current location, you can specify the exact file path/location in the above commands.

Make .run file executable

My file is now marked as executable. The system indicates it by a change in color of the filename when listed through the ls command:

Читайте также:  Vps linux pas cher

Check file permissions

Once your .bin/.run file has become executable, you can use the following command to execute/run it:

You can specify the path of the executable file in the above command if it does not exist in the current folder you are in.

Execute .run file

My sample file is pretty much an empty file. In the case of a proper installation package, the installation process will begin after you execute the file.

This is the power of the Ubuntu command line. You can install rare software packages available in the .run and .bin formats easily on your system.

About This Site

Vitux.com aims to become a Linux compendium with lots of unique and up to date tutorials.

Latest Tutorials

Источник

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.

Источник

Оцените статью
Adblock
detector