🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › how-to-run-file-in-linux
How to Run a File in Linux - GeeksforGeeks
July 23, 2025 - In Linux, you can run files using two methods. The first is through the file manager, where you can double-click on executable files to run them. The second is by using the terminal command line, where you execute files with commands like ./filename.
🌐
Living the Linux Lifestyle
livingthelinuxlifestyle.wordpress.com › 2020 › 02 › 09 › how-to-execute-files-in-linux
How to Execute Files in Linux – Living the Linux Lifestyle
February 9, 2020 - You can mark some files as executable within the GUI. Start your favorite file manager, then navigate to the desired program. Right-click the program, then select the “Permissions” tab. Under Execute, change the permissions to the desired value, such as Only Owner, Only Owner and Group, or Anyone.
Discussions

linux - how to run/execute a file in the command line without the ./ - Stack Overflow
Show activity on this post. If you want to execute this file specific to local user then create ~/bin directory put the file inside of it and append this path to your $PATH env. ':' is a separator Check following link. http://www.cyberciti.biz/faq/unix-linux-adding-path/ More on stackoverflow.com
🌐 stackoverflow.com
How can i run a downloaded file?
you should give more details. you extract the files from the archive, then what to do next totally depends on the files that were in the archive. so extract the files, and give more details. More on reddit.com
🌐 r/linux4noobs
21
1
March 9, 2023
command line - Why do we use "./" (dot slash) to execute a file in Linux/UNIX? - Unix & Linux Stack Exchange
It largely is, but it definitely ... 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. ... Just have absolute paths in the PATH environment variable. ... In Linux, UNIX and related operating systems, . denotes the current directory. Since you want to run a file in your current ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
November 30, 2010
how to run a .bat file on linux?
🌐 r/linux4noobs
34
10
November 24, 2023
🌐
Parklanejewelry
www2.parklanejewelry.com › home › 5+ compelling ways to execute a file in linux
5+ Compelling Ways To Execute A File In Linux
March 23, 2025 - There are two main ways to execute a file in Linux: using the command line or using a graphical file manager. To execute a file using the command line, open a terminal window and navigate to the directory where the file is located.
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › linux › how to run files in linux: 9 steps (with pictures) - wikihow
How to Run Files in Linux: 9 Steps (with Pictures) - wikiHow
June 18, 2025 - This wikiHow teaches you how to run files in Linux. You can run most files using a file manager program. Most Linux distributions have a default File Manager that comes pre-installed. You can also use the Terminal to run a file in Linux....
🌐
Stack Overflow
stackoverflow.com › questions › 35259825 › linux-how-to-run-execute-a-file-in-the-command-line-without-the
linux - how to run/execute a file in the command line without the ./ - Stack Overflow
Any file where? In the current directory? If yes, then add . to your PATH 2016-02-07T22:51:03.167Z+00:00 ... ...notice that this approach is unsafe. Check out @Microfed comment on your question post. 2016-02-09T05:39:22.483Z+00:00 ... Save this answer. ... Show activity on this post. You can add . to your PATH so the shell will execute whatever it is in your current working directory.
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › linux › how to execute .run files (& more) in linux: 2 easy ways
How to Execute .RUN Files (& More) in Linux: 2 Easy Ways
May 1, 2026 - In the default file manager in Ubuntu and many other versions of Linux, you can do this by right-clicking (or control-clicking) the file you want to run and selecting Properties. It should be similar in other file managers.
🌐
Parklanejewelry
www2.parklanejewelry.com › home › 5+ ways to execute a file in linux (with clear examples)
5+ Ways to Execute a File in Linux (with Clear Examples)
March 22, 2025 - Running a file in Linux involves executing a program or script. To do so, you can use the terminal, which is a command-line interface that allows you to interact with the operating system. There are several ways to run a file in Linux, depending on the type of file and your desired outcome.
Find elsewhere
🌐
Tutorials-db
tutorials-db.com › uncategorized › how to execute a file in linux
Master How To EXECUTE A FILE In LINUX - Step-by-Step!
April 16, 2025 - Using a file manager, you can also right-click on the file, and select "Run" or "Open With" to execute it directly. This method is more user-friendly, especially for those who prefer a graphical interface.
🌐
Quora
quora.com › How-do-I-run-a-file-in-terminal-using-Linux
How to run a file in terminal using Linux - Quora
Answer (1 of 5): You can only run executable files. You can confer executable properties to any file using the chmod command. You need to do this if the file is a script that you wrote. If the file was created by a compiler & linker, it almost certainly has executable permissions. If you don't kn...
🌐
MakeUseOf
makeuseof.com › home › linux › how to read and execute from a file with the linux source command
How to Read and Execute From a File With the Linux source Command
September 23, 2022 - To test it out, write the commands in the code box above in a new file and use the source command instead of making it executable. # Create a new file and edit it vi test file . test_file echo $TEST # This will return "bed" As you can see, using the source command, you were able to update the environment variables of the parent process. This is the primary use case of the source command, i.e., to modify the parent environment. ... That's all the steps you need to update the Bash shell environment with the source command. The difference between Linux bash and source commands is that when you execute a script with the bash command, it tells the Linux kernel to create a new Bash process to read and execute the script, copy the output to the original shell process, and display it.
🌐
Gcore
gcore.com › home › developers › how to make a file executable in linux
How to Make a File Executable in Linux | Step-by-step Guide
April 8, 2025 - Running an Executable. Once a file is executable, you can run it from the terminal. If the file is in your current directory, you’d typically prefix it with ./, as in ./my_script.sh. Let’s walk through the steps to make a file executable in Linux.
🌐
Reddit
reddit.com › r/linux4noobs › how can i run a downloaded file?
How can i run a downloaded file? : r/linux4noobs
March 9, 2023 - Windows executables do not run natively on Linux so you will have to run it trough wine. You might need to get additional DLLs, like dotnet45, with winetricks (not shipped with wine, you have to manually install it) if the program throws you an error. Once you have everything set up and extracted the zip contents to a local folder, go to that folder > right click > open terminal and run wine ./emulator.exe or whatever the file might be called.
🌐
Wikihow
wikihow.com › computers and electronics › internet › downloading › file sharing › how to run a file in unix: 3 steps (with pictures) - wikihow
How to Run a File in Unix: 3 Steps (with Pictures) - wikiHow
December 23, 2024 - You can run a file in UNIX by invoking the file name from the command line. Alternatively, you can also choose to invoke a specific shell to run the file. Check that you have permission to run (or) execute the file.
🌐
Medium
medium.com › @peey › how-to-make-a-file-executable-in-linux-99f2070306b5
How to make a file executable in linux? | by Peeyush Kushwaha | Medium
August 30, 2016 - To execute a file all we need to do is enter the path of the file on the command prompt. We’ll also need execute permissions on the file, like to read a file we’d need read permissions.
Top answer
1 of 6
130

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.

2 of 6
101

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.

🌐
LinuxVox
linuxvox.com › blog › execute-a-file-in-linux
Executing Files in Linux: A Comprehensive Guide — linuxvox.com
If the file is located in one of the directories listed in the PATH environment variable, you can execute it without specifying the full path. # Check the PATH variable echo $PATH # For example, if /usr/local/bin is in the PATH and your script is there # You can directly run the script test_script · Using #!/usr/bin/env interpreter in the shebang line is a good practice as it allows the system to find the interpreter in the PATH environment variable.
🌐
LinuxWays
linuxways.net › ubuntu › how-do-i-run-a-file-in-a-terminal-using-linux-ubuntu
How do I run a file in a terminal using Linux/Ubuntu? – LinuxWays
To run a text file in Ubuntu, use the “nano” command along with the file name. In the following example, we are executing the nano command to run the “abc.txt” file: ... We can use the terminal to run ODT Files as well. To run the ODT File in Linux, use the “lowriter” command:
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
how do you execute a file from terminal? / Newbie Corner / Arch Linux Forums
July 17, 2009 - Not being able to run executable files in the same directory as you are in is a security measure. You can always do ./$executable as said before, or, if it's a script, call the interpreter to execute it: ... Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy