Better Programming

Advice for programmers.

Follow publication

3 Interactive Command Tools for Linux

Handle Linux commands the easy way

Kirshi Yin
Better Programming
Published in
5 min readDec 20, 2022
Code on screen
Photo by Karl Pawlowicz on Unsplash

It’s challenging to remember Linux commands. We know by heart the ones we use to fulfill everyday tasks. We tend to forget about long commands and scripts we executed in the past.

It would be nice to get a hint of what we’re looking for. This way, we can focus on completing our task instead of trying to memorize the commands.

I’ve collected three handy tools to help you with Linux commands. You’ll easily achieve such tasks: finding a command from the history, executing one-liners from a cheat sheet straight away, etc.

Let’s get started!

1. Peco

Peco is a simple-to-use interactive filtering tool. It’s similar to grep, but it’s more powerful because you can type while searching for something.

Peco can be handy in numerous use cases. Imagine you want to search for files, logs, processes, etc. You don’t have to remember complicated command combinations. It’s enough to combine the primary command (e.g. ls, history, find, etc.) with peco. Then start filtering the results as you type.

Installation

To install the tool on Ubuntu, run the following command:

sudo apt-get install peco

Check the documentation for more installation options.

Demo

Let’s filter the history to find what curl commands we executed in the past. Here’s what that looks like:

QUERY> curl medi 572 curl https://medium.com — pops up in history | peco section
Using peco with history

As you’ve probably noticed, it supports AND style queries. I typed “medi” after the curl command, and it filtered curl https://medium.com. This way, you get more accurate results faster.

To exit the query prompt, press Ctrl + C.

Let’s see another example where we combine peco with nestat to filter ports:

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Kirshi Yin
Kirshi Yin

Written by Kirshi Yin

Self-taught Java Developer. Explores topics about Spring Boot, NLP, Linux, low-coding, and more. Interested in foreign languages, investment, personal growth.

Responses (1)

Write a response