There isn’t a shortage of task-killing applications on Linux. However, there is a severe lack of simple task-killing tools that focus primarily on the Linux terminal. Introducing Gkill: the Google Go-based app killing tool for the command-line. Gkill can filter through programs and stop problem programs. There is no messing with kill commands, or clunky interfaces.

Install Google Go

Using Gkill starts off by installing Google’s Go programming language. Open up a terminal and enter the commands that correspond to your operating system.

Note: even though Ubuntu, Debian, and others have a specific installation package for Google Go,  the $GOPATH may fail to set up correctly. To fix this, follow the path instructions under the “Other Linuxes” section of this tutorial.

Ubuntu

sudo apt install golang

Debian

sudo apt-get install golang

Arch Linux

sudo pacman -S golang

Fedora

sudo dnf install golang

OpenSUSE

sudo zypper install go

Other Linuxes

Google Go is pretty easy to get running on nearly every Linux distribution. Start off by downloading the latest release with wget.

wget https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz

Now that the archive is done downloading, it’s time to extract the contents of it directly to /usr/local/. We accomplish this by adding a -C to the tar command.

‘);
if (navigator.appVersion.indexOf(“Mac”)!=-1) document.write(”);

RECOMMENDED FOR YOU

sudo tar -C /usr/local -xvzf go1.10.2.linux-amd64.tar.gz

Go is primarily used by developers and coders, so you’ll need to set up a project folder. Create this folder in your /home/username/ directory. Keep in mind that each user that plans to use Go for programming will also need to set up a project folder.

Using the mkdir tool, create a project folder. Be sure to add a -p to preserve the permission settings of ~/. 

mkdir -p ~/golang-projects/{bin,src,pkg}

Next, enter the new directory with the CD command.

cd ~/golang-projects/

Using the Nano text editor, open ~/bash_profile and add the following code to the file at the end.

First, paste in the path for Go to use.

export PATH=$PATH:/usr/local/go/bin

A path is set up. Next, paste these two lines in ~/.bash_profile to specify the GOPATH and GOBIN locations.

export GOPATH="$HOME/golang-projects"

export GOBIN="$GOPATH/bin"

When all code is inside the file, press Ctrl + O to save. Press Ctrl + X to close Nano.

Installing Gkill

As Gkill uses Google Go, there isn’t a pre-packaged version of it in any of the mainstream Linux distribution software repositories (there isn’t even an AUR package). Instead, those looking to install the software will need to use Go’s get function to grab the code directly from Github.

go get github.com/heppu/gkill

To launch the Gkill app, be sure that all the paths are set up. If you haven’t done this, do so by following the instructions above. If everything is set up correctly, it should be possible to launch the Gkill app at any time with this command in the terminal:

gkill

It is also possible to run the Gkill app directly, by navigating to the correct folder. First, CD into the ~/golang-projects folder.

cd ~/golang-projects

After that, use the CD command once again to move directly to the bin subfolder.

cd bin

It is now possible to run the Gkill app with the ./ command.

./gkill

As you launch the Gkill app with the proper command, a very minimalistic task manager tool will appear. It doesn’t take up the entire screen. It will show a rundown of all active programs running on your Linux PC. To kill an app, first, use the arrow keys to navigate up and down. Select an application using the enter key.

Pressing enter will instantly kill the program and stop it in its tracks.

Another way to quickly find stop a problem program is by using the Gkill filtering system. To use it, start typing the name of the application you want to see. Gkill will instantly filter through and show you the correct results. From here, use the arrow keys on the keyboard to select it. Like usual, kill the process by pressing the enter key on your keyboard.

To close the Gkill app, regardless of how you launched it, use the Ctrl + Z shortcut in the terminal. From there, run the jobs command to list processes the terminal session has abandoned.

Take note of the number next to the stopped Gkill job. Then go back to the terminal and use the jobs stop command to end the abandoned process.

Note: be sure to replace X in the command with the number next to the job (1, etc).

jobs stop X

Uninstalling Gkill

The quickest way to remove Gkill from the system is to delete the golang-projects folder and create a new one. Deleting is much faster than sorting through the bin and pkg folders for the right files to delete. Start off by removing the golang-projects folder.

Note: before deleting the projects folder, be sure to move any important Google Go related files to another folder for safe keeping.

rm -rf ~/golang-projects

mkdir -p ~/golang-projects/{bin,src,pkg}

Leave a comment

  • Pingback: How To Use Gkill To Stop Problem Programs Running On Linux | SkyNet Chronicles()