DEV Community

Cover image for 5 Terminal Commands That Saved Me Hours of Clicking
Maame Afua A. P. Fordjour
Maame Afua A. P. Fordjour

Posted on

5 Terminal Commands That Saved Me Hours of Clicking

When I first started coding, I was terrified of the terminal.

That blank black screen with the blinking green cursor? It looked like something out of The Matrix, something only "senior engineers" with grey beards knew how to use. Me? I loved my mouse. I loved my GUI. I was a professional at dragging and dropping files and right-clicking to create new folders.

But as I started building projects and diving into more complex tools, the GUI started feeling... slow.

I found myself clicking through ten layers of nested folders just to find one file. My wrist was actually starting to hurt from all the double-clicking. I realized that if I wanted to be fast, efficient, and actually understand what the computer was doing, I had to ditch the mouse and embrace the command line.

It was awkward at first. My muscle memory fought me every step of the way. But once I got past the initial learning curve, I realized I could do things in seconds that used to take minutes.

Here are the 5 basic commands that finally convinced me to switch sides. 👇

1. The Teleporter: cd (plus Tab Completion)

The Old Way (GUI): Open file explorer. Double-click "Documents". Double-click "Coding". Double-click "Python". Double-click "Projects". Realize I clicked the wrong one. Go back. Double-click "Web-App".

The Terminal Way:

cd ~/Doc[TAB]/Cod[TAB]/Py[TAB]/Proj[TAB]/Web[TAB]
Enter fullscreen mode Exit fullscreen mode

Why I love it: cd stands for "Change Directory." It’s simple, but when you combine it with the Tab key, it’s a superpower. You just type the first few letters of a folder, hit Tab, and the terminal autocompletes the name for you.

It feels less like walking through a maze of folders and more like teleporting directly to where you need to be.⚡️

2. The Instant Architect: mkdir -p

The Old Way (GUI): I need to set up a new project structure. Right-click -> New Folder -> type "my-app". Open folder. Right-click -> New Folder -> type "src". Open folder. Right-click -> New Folder -> type "components". Go back up. Right-click -> New Folder -> type "assets".

So. Much. Clicking. 😫

The Terminal Way:

mkdir -p my-app/{src/components,assets,tests}
Enter fullscreen mode Exit fullscreen mode

Why I love it: mkdir means "Make Directory." But the magic here is the -p flag (parent) and those curly braces {}. This single line creates my main folder AND all the subfolders inside it instantly. It’s like snapping your fingers and having a building appear.

3. The "Safety Net": cp -r

The Old Way (GUI): I'm about to try a completely reckless refactor of my code that might break everything. I need a backup. I go to the parent folder, right-click my project folder, click "Copy," right-click blank space, click "Paste." Wait for the computer to calculate file sizes... wait for the copy bar to finish... rename the new folder to "project-backup".

The Terminal Way:

cp -r my-cool-project my-cool-project-BACKUP
Enter fullscreen mode Exit fullscreen mode

Why I love it: cp is Copy. The -r stands for "recursive," which just means "copy the folder and every single thing inside it." It’s blazing fast. Before I try anything stupid with my code, I run this command in one second, and I have instant peace of mind. 😌

4. The Mass Cleaner: The Wildcard *

The Old Way (GUI): My Downloads folder is a disaster zone of PDFs, images, and chaotic zip files. I want to move just the images to my Pictures folder. I have to scroll through, hold down Ctrl (or Cmd), and gingerly click every single .jpg and .png file, hoping I don't accidentally let go of the key and have to start over. Then drag them all over.

The Terminal Way:

mv ~/Downloads/*.jpg ~/Pictures/
mv ~/Downloads/*.png ~/Pictures/
Enter fullscreen mode Exit fullscreen mode

Why I love it: Okay, the asterisk * isn't technically a command, it's a wildcard. But combined with mv (Move), it changed my life. The * basically means "everything." So *.jpg means "everything that ends in .jpg".

It makes organizing messy folders unbelievably satisfying. 🧹

5. The Detective: grep -r

The Old Way (GUI): My code is throwing an error related to a variable named api_key_v2. I have no idea where I defined that variable. I open VS Code, open 15 different tabs, and start doing Ctrl+F in every single file trying to find it.

The Terminal Way:

grep -r "api_key_v2" .
Enter fullscreen mode Exit fullscreen mode

Why I love it: grep is basically a search-and-rescue dog for text. The -r flag tells it to look "recursively" through the current folder (.) and every folder underneath it.

It instantly spits out the exact file and line number where that text exists. It makes debugging giant codebases feel way less overwhelming.

Just Try It for a Week

Look, I still use VS Code. I still use a browser. GUIs aren't evil.

But getting comfortable with these basics changed my relationship with my computer. I stopped feeling like a "user" navigating a system someone else built, and started feeling like an "engineer" controlling the system directly.

If you're scared of the black screen, try forcing yourself to use it for just these five tasks for one week. Your mouse hand will thank you. 🙏

Top comments (34)

Collapse
 
varshithvhegde profile image
Varshith V Hegde

just do rm -rf *

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

thanks for the feedback. 😊

Collapse
 
varshithvhegde profile image
Varshith V Hegde

Fun aside , Great Post !!

Collapse
 
james_mulberry_a296b71fb8 profile image
James Mulberry

and if computer complains, add ‘sudo’ at the beginning lol

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Thanks for the addition James!

Collapse
 
xwero profile image
david duymelinck • Edited

I wouldn't call myself an engineer just for using the terminal 😊

The terminal actions I use the most are arrow up, to execute a command in the recent history and history | grep 'something useful' to find an older command and use an exclamation mark and the number in the history to execute it.
If I use a command very frequent I make an alias.

That is the power of working with commands, instead of GUI's.

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

100%. The re-usability is the best part. Thanks for reading!

Collapse
 
lovestaco profile image
Athreya aka Maneshwar • Edited

cd ~/Doc[TAB]/Cod[TAB]/Py[TAB]/Proj[TAB]/Web[TAB]

Try z, you'll love it

FreeDevTools


and start doing Ctrl+F in every single file trying to find it

Use Ctrl + Shift + F, 10x powerful with inclusion and exclusion

If you don't wanna use VSCode, use ripgrep

GitHub logo BurntSushi / ripgrep

ripgrep recursively searches directories for a regex pattern while respecting your gitignore

ripgrep (rg)

ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern. By default, ripgrep will respect gitignore rules and automatically skip hidden files/directories and binary files. (To disable all automatic filtering by default, use rg -uuu.) ripgrep has first class support on Windows, macOS and Linux, with binary downloads available for every release. ripgrep is similar to other popular search tools like The Silver Searcher, ack and grep.

Build status Crates.io Packaging status

Dual-licensed under MIT or the UNLICENSE.

CHANGELOG

Please see the CHANGELOG for a release history.

Documentation quick links

Screenshot of search results

A screenshot of a sample search with ripgrep

Quick examples comparing tools

This example searches the entire Linux kernel source tree (after running make defconfig && make -j8) for [A-Z]+_SUSPEND, where all matches must be words. Timings were collected on a system…

rg "api_key_v2" .

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Thanks for this, will definitely look into it.

Collapse
 
art_light profile image
Art light

This really captures how small terminal habits can unlock huge efficiency gains. I like the practical command choices here, and it makes me curious which workflows or commands you plan to build on next as your projects grow.

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Thanks! I’m glad you liked the practical examples.

Collapse
 
thetoolwiz profile image
David Schwartz • Edited

For someone who learned to program before command lines ever existed, this is kind of funny to read. For me, in the beginning there was BASIC. Then IBM punch cards. Eventually micro-computers came along and CP/M was invented by Gary Kildall at Digital Research. Interestingly, he created a couple of things for Intel in the 70's called ISIS (an OS) and PL/M, a compiler we used that ran on ISIS. CP/M was very similar to ISIS. And DOS was a close clone of CP/M. My first boss at Intel used to work with Gary and shared some interesting stories about stuff they did when he was there.

I'd heard of Unix but Intel had ISIS and PL/M, and Unix was not something that interested them. I spent a couple of years doing some stuff and ended up writing a dozen different tools that I later learned were standard issue on Unix. In 1985 I went to work with Motorola on the team porting Unix System V R3 to the 68020. My first day on the job, my boss handed me a 2" thick comb-bound book that had all of the man pages printed out for it and said, "Here, go through this and learn Unix." I did, and that's when I learned the Unix version of the tools I had written. Unix was a far cry better than ISIS and CP/M.

I was laid-off of Moto a couple of years later and bought my first PC (1988 or so) and nearly gagged on the limitations of the DOS prompt. It SUCKED compared to the Korn shell (ksh) and all of the standard Unix command tools. A few years later, Windows 3.0 came out, but it was big, fat, slow, and I hated using the mouse. Life was WAY FASTER using a shell.

Those commands you mentioned have all evolved over time -- computers have gotten faster and a lot of work can now be done between keystrokes. Back in the early CP/M and DOS days, every letter took time to process. Filenames were limited to an 8.3 naming format because of how the directory blocks were structured.

Curiously, I'm finding the use of the "command prompt" in AI platforms like deja vu ... it's 2025 and the most advanced software on the planet has started out life using a ... command prompt. And we're stuck with the same problems we had in the 70's and 80's, like the fact that the only way to distribute anything is as SOURCE CODE. Unless you want to turn your prompts into a form of "batch file" called a GPT that only runs on a single platform (as of today). Never mind that there are over 1000 AI platforms now, and more being born every day.

Why are we starting out with dumb command lines, and why is the only way to distribute AI prompts limited to source code? Because nobody working on these was alive before Windows existed!

This industry has been down this road before, a few times. The nice part is that all of the Unix commands I learned in 1986 still work today. And I can still edit files in vi without having to think about it -- thankfully, my fingers still just know the keystrokes I need to type to get a lot of things done, because my memory has forgotten most of them. In fact, it's encouraging that my M4 Mac Mini's Terminal shell still knows what I'm telling it to do. And it still runs the Korn Shell. :)

PS: you should spend some time learning how the 'find' command works...

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Thank you so much for this wisdom David! Really informative…

Collapse
 
nadeem_rider profile image
Nadeem Zia

Very helpful

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Glad it is!

Collapse
 
marc_kirkwood_13a70f8b4f7 profile image
Marc Kirkwood • Edited

Some good tips! As well as zoxide, mentioned a few times in comments, I use Ctrl+R ("recursive history search") often and it saves me from having to pipe history output to grep, or hit the up arrow repeatedly. I like telling people about it as a total gamechanger. Just start typing anything from a previous command when the prompt changes, hit Ctrl+R until you find a match, then Enter.

As someone with vim bindings wherever possible, setting readline mode to "vi" is also a nice addition to the command line--though sometimes it's nice to just edit the whole thing in an editor first.

As I curate custom aliases, I like having the "edalias" and "srcalias" aliases in my ~/.bashrc, to respectively edit and source other aliases quickly.

"fd" is typically much faster for recursive finding than the "find" command, and I second the ripgrep recommendation. rsync is worth knowing about as it can be much more efficient at copying, especially between networks or filesystems, and it can even be used as a quicker way to delete lots of small files when you notice long delays--as I did with a mounted NFS path that struggled with bandwidth for directories with lots of small files (node_modules/ and python .venv, for example).

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Thank you Marc

Collapse
 
josephnkwantabisa profile image
Nkwantabisa Joseph

rm -theEntireOperatingSystem 👍

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Thank you Joseph

Collapse
 
madhuhari188 profile image
Madhusudhanan

I really like this post

The comment Teleporter and Wildcard are so useful, this makes me wonder how I wasted my time on infinite clickings

Aslo this is my First comment on the Dev.to

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

I’m honored that this is your first comment on Dev.to! Welcome to the community. 🙌

I totally get that feeling, once you start using the wildcard and tab completion, going back to clicking feels like it takes forever. Glad you found the tips useful!

Collapse
 
mrdgh2821 profile image
Mihir Rabade

Let me introduce you Zoxide (github.com/ajeetdsouza/zoxide)

This will make you even faster!

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Thank you Mihir, will check it out😊.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.