I am new to Linux. I am currently trying to write a command line which should execute a *.exe inside a folder abc.
I have tried
% cd abc info.exe
But the error says
no such file or directory.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
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.
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.
cd abc/ wine info.exe
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)
chmod a+x info.exe
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.
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.
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.
/home/username/abc/info.exe(depends on where it actually is)
PATHthat is searched by the shell to find binaries. For example,
cp abc/info.exe ~/bin/. If
~/binis part of
PATH, you can now run
info.exewithout qualifying it.
PATH, for example,
export PATH=~/abc:$PATH. Note that this is for the current shell only, unless you add this line to your
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