DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Kristian
Kristian

Posted on

How to improve your command line skills

The command line is a text interface for your computer. It’s often called the β€œshell” because it’s the outermost layer around the operating system. The command line has been around for a long time. It was the only way to interact with early computers. Today it's often not necessary to use it at all but getting familiar with it can increase your productivity and give you a whole new level of control.

If you’re new to the command line, don’t be discouraged. It can seem daunting at first, but with a little practice, you’ll be surprised at how easy it is to use. In this blog post I want to show you 5 tricks and tools that make my life easier in the command line.

1) Search for previous commands
Instead of searching for the command you typed 10 minutes ago by endlessly hitting the UP key you can simply search for it with the "reverse search":

reverse search in the shell

Start by pressing Ctrl and R. To find a command in your history that starts with a certain letter, type that letter. For example, typing "f" will bring up the most recent command in your history that contains "f". You can keep typing to narrow your search until you find the desired command. Then press Enter to execute the suggested command.

2) 1-Week Shell Challenge
For one whole week, try to do everything you usually do via the GUI with the terminal. This includes moving (mv) & copying (cp) files around, git interaction etc. If you don't know how to do something just google it. After this challenge you might not go back to the GUI for some of the tasks, promised!

3) https://explainshell.com
Screenshot of explainshell.com

A neat website where you can paste commands and it will unwrap all the arguments and show what they mean and how to use them.

4) https://getaido.app/

A free command line tool I built myself :)


Aido is an ai-powered shell command generator. Type aido followed by a description of what you want to do in the command line and it will generate the shell command. You can also have it explain commands for you by passing the --explainflag in the beginning like:
aido --explain 'mv *.jpg pictures' This helps to avoid context switching and is faster than googling.

5) Clean up your terminal
After running a few commands the terminal can get messy with all the output it produces. A simple CTRL + L will get rid of all output and you can continue with a fresh window.

That's it! What is your favourite terminal trick and command? Let me know in the comments!

Top comments (0)

New programmer and javascript

Stop by this week's meme thread!