How to run application on linux

How to run an application on Linux from the terminal

This tutorial explains how to run an application on Linux from the terminal by typing the application name. This allows you to run AppImages, scripts or any executable file from a terminal, even though you have not installed it via any type of package manager.

The quick TL;DR (Too Long; Didn’t Read) below will most likely be enough to answer your question. The remaining article gives some more technical background infos.

The quick TL;DR answer

Copy the application itself or a link to the application to the .local/bin folder in your home directory. You can now run it by typing the exact name of the file into the terminal.

If you can’t see the .local folder in your home directory, press Ctrl + H to show hidden files. This hotkey works in all popular file managers. If it doesn’t, look around your file manager’s menus.

If the .local or bin folder doesn’t exist, simply create it yourself. In this case, you also have to log out and back in again before the terminal recognizes applications or application links inside the bin folder.

What is $PATH?

Linux uses various other folders that it scans for applications or application links. If you type something into a terminal and Linux can find an application with that name in one of these folders, the application will run.

These folders are commonly called “$PATH” or just “PATH”. You can find out which folders are part of your $PATH by running echo $PATH in a terminal. The output will look similar to this:

The colons are line breaks, which means that I’ve got the following folders as part of my $PATH on my machine:

  • /usr/local/sbin
  • /usr/local/bin
  • /usr/sbin
  • /usr/bin
  • /sbin
  • /bin
  • /usr/games
  • /usr/local/games
  • /snap/bin

These folders are used for different purposes. If you didn’t use the method outlined in the quick TL;DR answer, you will usually want to put your application links into /usr/local/bin (instead of /home/user/.local/bin ). There is a Wikipedia page about the Filesystem Hierarchy Standard that explains what most of the folders listed above are for and what the differences are.

Contrary to the /home/user/.local/bin folder, all of the folders listed above require Root rights ( sudo ) to modify the files inside them. This means that you can’t simply copy your links into them without some extra steps.

The ln terminal command allows you to create a link to a file at a location of your choice. The syntax is:

ln [parameters] [original file path] [target path and file name]

By writing sudo before it, you can create links in folders that require admin rights. Adding the -s parameter creates a soft link instead of a hard link to your file. This excellent article explains the difference between hard and soft links.

Читайте также:  Yum in red hat linux

Here’s what this looks like if I want to create a link from a Krita AppImage in /home/victor/Applications to /usr/local/bin :

sudo ln -s /home/victor/Applications/krita-4.4.5-x86_64.appimage /usr/local/bin/krita

If you want to override an existing link (for example if the location of your AppImage has changed and the link is now broken), you have to add the -f parameter:

sudo ln -s -f /home/victor/Applications/krita-4.4.5-x86_64.appimage /usr/local/bin/krita

If you want to remove a file in this folder, you can use the rm command, like so:

sudo rm /usr/local/bin/name_of_your_file

Visit the Linux tutorials main page for more Linux tutorials.

Recent Posts

  • Transcendental experiences related to my father’s death 9. January 2023
  • How to delete old revisions in SVN 29. January 2022
  • How to install Linux Mint on Windows in VirtualBox 14. December 2021
  • A short beginner’s guide to growing plants 14. December 2021
  • How to install the latest version of git-cola on Debian/Ubuntu 25. October 2021
  • 2023 (1)
  • 2022 (1)
  • 2021 (16)
  • 2020 (14)
  • 2019 (6)
  • 2016 (13)
  • 2012 (4)
  • 2011 (40)

Источник

Brilliant Ways on How to Run a Program in Linux

Ransomware recovery test drive: This technical workshop is designed to take you behind the scenes and shows you how to adopt strategies to automate recovery, ensuring you’re ready to become a recovery hero. REQUEST YOUR LAB

If you are new to Linux, particularly the command line, and want to learn how to run a program in Linux, you’ve come to the right spot. Running programs in Linux is no different than how it’s done in Windows. Easy to say, right? But no worries, you’ll get to run any program in no time.

In this tutorial, you’ll learn many ways to run programs in Linux, both via GUI and a command-line environment. From a novice Linux user to a power user, you will find knowing these methods to run a program helpful.

Prerequisites

Ubuntu Desktop 15.04 or later – Ensure you have a Linux host ready to go. This tutorial uses Ubuntu 15.04 (Desktop version) with GNOME installed, but any newer distribution should work similarly.

Launching Programs with the Application (App) Launcher

There are generally multiple ways to run a program within Windows, and Linux is no different. We will start with the most common way to run a program using the Launcher.

The most common method to run programs in Linux is to use the Launcher. The Launcher is a bar similar to the Windows start menu that contains a list of icons you can click on to run programs.

In Ubuntu, the App Launcher is located on the left side of the screen, as you can see below, containing default commonly run applications. To open the program, simply click the icon representing the program.

Accessing the Launcher programs through GUI

Launching Programs with the Applications Menu (Unity Dash)

You can also run programs in Ubuntu Linux with Unity Dash. The Applications Menu or Unity Dash is a handy way to search for and run programs in GNOME. To use the Applications Menu, click on the Ubuntu button in the top left corner.

Selecting the icon to search and launch programs using the Unity Dash

You’ll see below that the menu opens a search bar with any recently run programs.

Search for the program you want to run using the Unity Dash in older versions of Ubuntu

Type in the correct name of the program you are looking for (i.e Firefox) and it will appear, then select it to launch the program.

In Ubuntu Linux v20.04+, Unity Dash has been replaced with Activities in the upper left of your screen but the process to run a program remains the same.

Using the Run Command to Launch Program

Another way to launch programs in Linux is to use the Run command. The Run command is a handy way to quickly run a program in Linux by typing the program and executing it.

Читайте также:  Linux открытые порты udp

To run programs via the Run command, select the Alt-F2 to open the Run Command box.

You can also hit Alt-F2 as a shortcut to the run command.

Using the run command

Next, type the name of the program you want to run. In this example, you’ll run the Terminal application, type terminal, select the Terminal icon and hit Enter.

Selecting the icon or hitting enter will launch the program

You’ll see below that Linux will launch the Terminal application.

Running Programs Using Hot Keys

If you’re more of a keyboard ninja and would rather skip the mouse like we started with in the last example, you can also run programs with hotkeys. In all Linux distros, you can use the Super Key (Windows Key) + A. The Super Key will bring up all applications in alphabetical order and a text box to type in the name of a program, as shown below.

You can type the name of the program in the search box to navigate to the program or click on the program with your mouse if it appears immediately.

Running Programs Using Hot Keys

Setting Up Keyboard Shortcuts to Run Programs in Linux

Now that you have learned the GUI options to run programs, the remainder of this tutorial will focus on using non-GUI-based options to run programs. Let’s first begin with keyboard shortcuts. Using keyboard shortcuts can remove a lot of clicking around.

To set up keyboard shortcuts in Ubuntu:

1. Select the icon in the top left corner again and Keyboard Shortcut. The Keyboard application should show up below. When it does, click on it.

Selecting the icon and launching the Keyboard Shortcut

2. In the Keyboard application, click on the Shortcut tab.

In Ubuntu 20.04 and newer, selecting Keyboard Shortcut from the Activities menu brings you directly to the Shortcuts tab.

Accessing the Shortcuts Tab

3. Click on the + icon to create a new keyboard shortcut. Ubuntu will direct you to the Custom Shortcuts section.

Adding a New Shortcut

4. Next, enter a descriptive Name for the shortcut key and provide the Command (program) to execute and click Apply.

Entering the name and program to use for the Shortcut

When Ubuntu creates the shortcut, you’ll see that the Name shows up under Custom Shortcuts but it’s disabled.

Seeing the Created, but not Active Shortcut Key

5. Now, click on the Disabled text as shown above and press the desired keyboard shortcut such as Ctrl+T. Once you type your desired shortcut, it will show up, as shown below.

Activating the Shortcut

6. Finally, launch the application by pressing the keyboard shortcut!

Running a Program within the Terminal

Although if you’re a newcomer to Linux, chances are you’ll be running programs with the GUI but if you need to use the command line for any reason, the Terminal makes it easy to do so. The Terminal is a command-line application that allows you to manage all facets of Linux with the keyboard.

To run programs in the Terminal, open the App Launcher (or Activities) in the upper left corner and run the Terminal application as shown below.

Accessing the Terminal

When the Terminal opens, as shown below, simply type the name of the program and press Enter.

Running programs in the Terminal will not work for all programs. Some programs may not be in the PATH.

Launching the program end result

Conclusion

In this tutorial, you’ve learned many different methods to run programs in Linux. Using both GUI-based and command-line-based methods, you should now know how to launch programs wherever you are within Linux.

Try installing programs in Linux such as the tutorial to install a common program such as Docker for practice and then run it using a shortcut, command line, or GUI Interface. Which way will you use most often to run your favorite programs?

Читайте также:  Arch linux no display manager

Hate ads? Want to support the writer? Get many of our tutorials packaged as an ATA Guidebook.

Источник

How to Run Files in Linux

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 83,426 times.

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.

Using a File Manager

Image titled Run Files in Linux Step 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 and press Enter. On Fedora, open the Terminal and type sudo dnf install and press Enter. Replace «» with the name of the app you want to install. [2] X Research source

Image titled Run Files in Linux Step 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.

Image titled Run Files in Linux Step 3

  • Alternatively, you can double-click the file to run it using the default application that the file type is associated with.

Image titled Run Files in Linux Step 4

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

Image titled Run Files in Linux Step 5

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

Using the Terminal

Image titled Run Files in Linux Step 6

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.

Image titled Run Files in Linux Step 7

Image titled Run Files in Linux Step 8

  • If asked to do so, enter the password you use to log into your Linux computer and press Enter.

Image titled Run Files in Linux Step 9

  • Run a file: sudo ./ . This includes «.sh», «.run», and «.bin» files.
  • Open a file in it’s default application: xdg-open
  • Display an image file: display . You must have ImageMagick installed. [3] X Research source
  • Display a text file in the Terminal: cat .
  • Display a text file one page at a time: less
  • Display a text file with numbered lines: nl [4] X Research source

Expert Q&A

Tips

You Might Also Like

Restart Your Computer Using the Keyboard

Chatgpt Without Phone Number

How to Use ChatGPT & OpenAI Without a Phone Number

Check Browsing History on a WiFi Router

Pair Jbl Earbuds

6 Ways to Pair Your JBL Earbuds: Guide & Troubleshooting Tips

Turn on Keyboard Light Lenovo

How to Turn on Backlit Keyboard on Lenovo

Open a Digital Safe Without a Key

Connect PC to TV with HDMI

Find the Publication Date of a Website

Read Dump Files

Easy Ways to Read Crash Dump Files & Troubleshoot Crashes

Install the Google Play Store on an Amazon Fire

Hack a Computer

What Does DW Mean

What Does DW Mean? Snapchat, Texting, and More

Guess a Password

How to Guess a Password

Источник

Оцените статью
Adblock
detector