Software

Find A Command’s Binary

Today’s article should actually be fairly short and simple, as we learn how to find a command’s binary. For those of you who are new, I’ll do what I can to make this more clear. At the end of the day, all should become clear and it really shouldn’t take all that long.

So, when you run a command in the terminal, you’re calling the binary file that is that program. This is also true when you’re starting a command in a GUI environment. You’re loading a binary file. Well, no… You could be loading some sort of script – but most of the time you’re going to be loading a binary.

Well, what we’re going to do is show you where to find these binaries by using the ‘which’ command in the terminal.

HINT: They’re generally tucked away in /usr/bin/!

The command we’ll be using is the ‘which’ command. It’s a very simple command to use when you just want to find a command’s binary. If you run the ‘man which‘ command (not the sandwich made from burger) you’ll find it is described accurately, and as thus:

which – locate a command

And, that’s really all the command we need for this exercise. It’s dirt simple, but still worthy of its own article. Ready?

How To: Find A Command’s Binary:

Yup. You guessed it. We’ll be using the terminal for this article. We do that a lot at this site. So, open up your default terminal emulator. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, try any one of the following:

which dir

Or:

which firefox

Perhaps:

which teamviewer

That’s right, the entire usage is just:

which <application>

It even works for proprietary things, like:

which google-chrome

If you want to be more curious, you can even find the binary for the very ‘which’ we’re using in this article:

which which

See? This is so dirt simple that an absolute n00b can be up and using the ‘which’ command pretty much instantly! Using the terminal doesn’t have to be complicated. You can get comfortable using the terminal in just a few days and you’ll be better for it.

Closure:

So, yeah, that’s all the article you really need when your goal is to find a command’s binary file. It’s not even a wee bit difficult – and is a great way to explore the terminal when you’re new to it. Have fun!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

2 days ago

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

3 days ago

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

6 days ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

1 week ago

Demystifying journalctl: A Comprehensive Guide to Linux System Logging

It was suggested that I write an article about journalctl, which seemed like a large…

1 week ago

Extract Text From Multiple File Types

Today we will have a fairly simple exercise as we're going to just use a…

2 weeks ago