Videos
I'm pretty new to Linux and I've been using the Manjaro distro, and I wanna know if there's any way of running a linux executable through the terminal.
The literal answer is as others have given: because the current directory isn't in your $PATH.
But why? In short, it's for security. If you're looking in someone else's home directory (or /tmp), and type just gcc or ls, you want to know you're running the real one, not a malicious version your prankster friend has written which erases all your files. Another example would be test or [, which might override those commands in shell scripts, if your shell doesn't have those as built-ins.
Having . as the last entry in your path is a bit safer, but there are other attacks which make use of that. An easy one is to exploit common typos, like sl or ls-l. Or, find a common command that happens to be not installed on this system — vim, for example, since sysadmins are of above-average likelyhood to type that.
Does this sound too theoretical? It largely is, but it definitely can happen in reality, especially on multi-user systems. In fact, here is an example from this site where an administrator switched to a users' home directory and found ps to be masked by an executable of that name.
In Linux, UNIX and related operating systems, . denotes the current directory. Since you want to run a file in your current directory and that directory is not in your $PATH, you need the ./ bit to tell the shell where the executable is. So, ./foo means run the executable called foo that is in this directory.
You can use type or which to get the full path of any commands found in your $PATH.
When i download a zip file from a website then unzip it how can run it in the terminal?
EDIT: It's an emulator that i've downloaded, i unzipped it but don't know if im supposed to execute it nor which file to execute
try:
abc/info.exe
but if it's really a Windows program, you will need to install "wine", then do:
wine abc/info.exe
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.
cd abc/
wine info.exe
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
cd abc/
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.
./info.exe