PDF download Download Article PDF download Download Article

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. This is the preferred method for running ".run", ".sh", and ".bin" files.

Executing Files in Linux

Using a file manager, open the folder, right-click the file, press “Open With,” and select the application. Using the Terminal, press Ctrl+Alt+T. Type “cd” and the folder name. Then, type “sudo chmod +x” followed by the file name with no spaces. Type “sudo ./” followed directly by the file name.

Method 1
Method 1 of 2:

Using a File Manager

PDF download Download Article
  1. Most Linux distributions come with a default file manager program. This may be Nautilus, Thunar, Dolphin, Krusader, Konqueror, or PCManFM. Most of these programs work very similarly. To open your file manager, click the icon that resembles a file cabinet, or a folder that says "Home" on your desktop, dock, or Activities menu.[1]
    • If you are not sure where to locate your file browser app, you can press the Super (Windows) key and type "Files" (or the name of the file manager) in the search bar.
    • If you don't like the file manager that came with your Linux distribution, you can install a different file manager in the Terminal. To do so on Debian/Ubuntu, open the Terminal and type sudo apt install <app name> and press Enter. On Fedora, open the Terminal and type sudo dnf install <app name> and press Enter. Replace "<app name>" with the name of the app you want to install.[2]
  2. Most file managers have a large panel that allows you to browse folders. Double-click a folder to open it. Navigate to the folder with the file you want to run.
    Advertisement
  3. This displays a drop-down menu.
    • Alternatively, you can double-click the file to run it using the default application that the file type is associated with.
  4. This displays a list of applications you can use to run the file.
  5. This runs the file in the application you choose.
    • If you don't see the application you use to run the file, click View All Applications or Other. This displays a list of all installed apps categorized by type. Click the category of the app you want to run the file in. Then double-click the app you want to run the file in.
  6. Advertisement
Method 2
Method 2 of 2:

Using the Terminal

PDF download Download Article
  1. Press Ctrl+Alt+T to open the Terminal. You can open the Terminal by clicking the icon that resembles a black screen with a white text cursor in your Apps menu, or by press Ctrl+Alt+T on your keyboard.[3]
  2. To change the directory in the Terminal, type cd followed by the path of the directory and press Enter.
    • For example, if the file is in your documents folder, you would type cd /Documents.
  3. Replace "<filename>" with the actual name of the file (it cannot contain any spaces). This command sets the user permissions so that you can run and edit the file.
    • If asked to do so, enter the password you use to log into your Linux computer and press Enter.
  4. The command you use to open the file is going to be a different depending on the file type. Enter one of the following commands and press Enter to run the file. Replace "<filename>" with the actual filename for the file (i.g. "textfile.txt"). The filename cannot have any spaces. The following are some commands you can use to run a file in the Terminal:
    • Run a file:sudo ./<filename>. This includes ".sh", ".run", and ".bin" files.
    • Open a file in it's default application: xdg-open <filename>
    • Display an image file: display <filename>. You must have ImageMagick installed.
    • Display a text file in the Terminal: cat <filename>.
    • Display a text file one page at a time: less <filename>
    • Display a text file with numbered lines: nl <filename>
  5. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Execute .RUN Files in Linux Run a File in Linux: Terminal & GUI Methods
Run a Program from the Command Line on LinuxRun a Program from the Command Line on Linux
Run a File in UnixRun a File in Unix
Install Bin Files in LinuxInstall & Execute BIN files in Linux: Ubuntu, CentOS & More
Execute INSTALL.sh Files in Linux Using Terminal Run an INSTALL.sh Script on Linux in 4 Easy Steps
Run a BAT File on Windows3 Ways to Run a Batch (.BAT) file on Windows and More
Copy Files in Linux Copy Files in Linux: A Complete Guide
Create a File in a Directory in LinuxCreate a File in a Directory in Linux
Open Applications Using Terminal on MacOpen Applications Using Terminal on Mac
Create and Edit Text File in Linux by Using TerminalCreate and Edit Text File in Linux by Using Terminal
Can Linux Run ExeCan Linux Run .exe Files? How to Run Windows Software on Linux
Write a Shell Script Using Bash Shell in UbuntuWrite a Shell Script Using Bash Shell in Ubuntu
Change File Permissions in Linux from the TerminalChange File Permissions in Linux from the Terminal
Run an XML File on Linux Run an XML File on Linux
Advertisement

About This Article

Travis Boylls
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Travis Boylls. Travis has been a tech writer at wikiHow for more than 10 years. He has also worked in technical support for Dish Network and AT&T Wireless. He studied graphic design and web design at Pikes Peak Community College. He specializes in Windows, macOS, Linux, Android, iOS, and video game consoles. Travis has had a fascination with computers and technology that goes all the way back to childhood. He is proficient in all manner of software and computer operating systems. This article has been viewed 203,029 times.
How helpful is this?
Co-authors: 5
Updated: June 18, 2025
Views: 203,029
Article SummaryX

1. Open the Terminal.
2. Type "cd" followed by the path of the file and press Enter.
3. Type "sudo chmod +x " to change allow yourself permission to edit the file.
4. Type "./" to run the file.

Did this summary help you?

Thanks to all authors for creating a page that has been read 203,029 times.

Is this article up to date?

Advertisement