How to Run Files in Linux: 9 Steps (with Pictures) - wikiHow (2024)

  • Categories
  • Computers and Electronics
  • Operating Systems
  • Linux

Download Article

Explore this Article

methods

1Using a File Manager

2Using the Terminal

Other Sections

Related Articles

References

Article Summary

Written byTravis Boylls

Last Updated: February 22, 2023

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.

Method 1

Method 1 of 2:

Using a File Manager

Download Article

  1. 1

    Open a file manager application. 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. 2

    Navigate to the folder the file is located in. 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.

    Advertisem*nt

  3. 3

    Right-click the file you want to run. 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. 4

    Click Open With or Open With Other Appllicaiton. This displays a list of applications you can use to run the file.

  5. 5

    Double-click the application you want to run the file with. 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. Advertisem*nt

Method 2

Method 2 of 2:

Using the Terminal

Download Article

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

  2. 2

    Change the directory to the folder with the file you want to run. 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. 3

    Type sudo chmod +x <filename> and press Enter. 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. 4

    Type the command to run the file. 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.[3]
    • 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>[4]
  5. Advertisem*nt

Expert Q&A

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

      Advertisem*nt

      Tips

      Submit a Tip

      All tip submissions are carefully reviewed before being published

      Submit

      Thanks for submitting a tip for review!

      You Might Also Like

      4 Easy Ways to Find the Publication Date of a WebsiteHow toCheck Browsing History on a WiFi Router
      How toRestart Your Computer Using the KeyboardHow toConnect PC to TV with HDMIHow toTell if Your Mac Is Too Old to UpdateHow toOpen a Digital Safe Without a KeyHow to Add the Google Play Store to an Amazon Fire TabletWhat Does DW Mean? Snapchat, Texting, and MoreHow to Bypass Your Screen Time Passcode: Reset, Remove, or Hack Screen Time10 Genius Ways to Cheat a Step Counter on a Phone (No Walking Required)How toHack a ComputerHow toCreate a Desktop Shortcut

      Advertisem*nt

      About This Article

      How to Run Files in Linux: 9 Steps (with Pictures) - wikiHow (28)

      Written by:

      Travis Boylls

      wikiHow Technology Writer

      This article was co-authored by wikiHow staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for wikiHow. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College. This article has been viewed 142,018 times.

      How helpful is this?

      Co-authors: 5

      Updated: February 22, 2023

      Views:142,018

      Categories: Computers and Electronics | Linux

      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?

      In other languages

      Français:ouvrir ou exécuter des fichiers sous Linux

      Bahasa Indonesia:Menjalankan Berkas di Komputer Linux

      Português:Executar Arquivos no Linux

      • Print
      • Send fan mail to authors

      Thanks to all authors for creating a page that has been read 142,018 times.

      Is this article up to date?

      Advertisem*nt

      How to Run Files in Linux: 9 Steps (with Pictures) - wikiHow (2024)
      Top Articles
      Latest Posts
      Article information

      Author: Clemencia Bogisich Ret

      Last Updated:

      Views: 6694

      Rating: 5 / 5 (80 voted)

      Reviews: 95% of readers found this page helpful

      Author information

      Name: Clemencia Bogisich Ret

      Birthday: 2001-07-17

      Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

      Phone: +5934435460663

      Job: Central Hospitality Director

      Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

      Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.