20 Essential Bash Commands That Will Transform Your Command Line

20 Essential Bash Commands That Will Transform Your Command Line

If you’ve ever found yourself staring at a blinking terminal cursor, wondering if there’s more to life than ls and cd, you’re in for a treat. Bash isn’t just a command-line interface—it’s like the Swiss Army knife of your computer, packed with tools you probably didn’t know you needed but won’t be able to live without once you do.

As a TPM, you may not get to spend as much time in the abyss of the black-screen as developers but why shouldn’t you? By forcing myself to embrace being more proficient in navigating terminal, I can do things quicker than I would using a UI, do some fool around with more advanced scripting, and be on the same page as developers.

In this post, we’re diving into 20 essential Bash commands that I have handpicked that aren’t just useful, they’ll make you feel like a terminal wizard.

Let’s crack open the terminal and get to work.

1. pwdPrint Working Directory

Think of pwd as your digital “You Are Here” sign. It tells you exactly where you are in your system’s directory tree.

pwd

Why it’s essential: When you’ve burrowed deep into folders like ~/projects/2025/June/client_files/final_final_v2, it’s easy to lose track. pwd keeps you grounded.

2. cdChange Directory

Ah, cd, the command that gets you from A to B. Want to jump into a folder? This is your ticket.

cd Documents/Projects

Pro tip:

  • cd ~ takes you home (literally, to your home directory).
  • cd - is pure magic—it takes you back to the previous directory. Like Ctrl+Z but for folders.

3. lsList Directory Contents

If cd is how you move around, ls is how you see what’s around you.

ls -la

Why the -la?

  • -l gives you a detailed list (permissions, sizes, dates).
  • -a shows hidden files (those starting with .).

Combine them, and you’ve got x-ray vision for your folders.

4. cpCopy Files and Directories

Need to duplicate a file? cp has your back.

cp original.txt backup.txt

Want to copy entire directories? Add the -r (recursive) flag:

cp -r folder1 folder2

5. mvMove (or Rename) Files

Counterintuitively, mv isn’t just for moving files—it also renames them.

mv file.txt newfile.txt

Or to move it somewhere else entirely:

mv report.txt ~/Documents/Reports/

6. rmRemove Files and Directories

The digital equivalent of “delete,” rm is powerful—and unforgiving.

rm file.txt

Want to delete an entire folder?

rm -r folder/
Caution: There’s no “Recycle Bin” in Bash. Once it’s gone, it’s gone. Add -i for a confirmation prompt if you’re feeling cautious:
rm -ri folder/

7. touchCreate Empty Files

Need a new file in a hurry? touch is your best friend.

touch newfile.txt

Fun fact: If the file already exists, touch updates its timestamp. Great for sneaky version control tricks.

8. catConcatenate and Display File Contents

Despite the name, cat isn’t just for combining files—it’s commonly used to display file contents:

cat filename.txt

Want to combine files?

cat file1.txt file2.txt > combined.txt

9. grepSearch Text Using Patterns

grep is like Ctrl+F on steroids. It searches through files (or output) for specific text patterns.

grep "error" log.txt

Combine with -r to search through directories:

grep -r "TODO" ./codebase

10. findLocate Files and Directories

Lost a file somewhere in the abyss? find can track it down.

find /path/to/search -name "filename.txt"

Need to find all .log files?

find . -type f -name "*.log"

11. chmodChange File Permissions

File permissions got you locked out? chmod is here to help.

chmod 755 script.sh

This adjusts who can read, write, or execute the file. It’s a bit complex under the hood, but once you get it, you’ll feel like a security guru.

12. chownChange File Ownership

Need to transfer file ownership? chown does the job.

sudo chown username:group file.txt

Pro tip: Use with sudo if changing ownership of system files. But don’t go wild—misusing it can cause system hiccups.

13. echoDisplay a Line of Text

Simple yet versatile, echo outputs text to the terminal.

echo "Hello, world!"

Bonus: Use it for quick environment variable checks.

echo $PATH

14. manRead Manual Pages

Feeling stuck? man is your built-in cheat sheet.

man grep

It opens the manual for any command. Navigation pro tip: Press q to quit.

15. historyView Command History

Ever wish you could recall that perfect command you typed last Tuesday? history has your back.

history

Re-run a command by its number:

!123

16. aliasCreate Shortcuts for Commands

Tired of typing ls -la? Make it an alias:

alias ll='ls -la'

Permanent aliases can be added to ~/.bashrc or ~/.bash_profile.

17. wgetDownload Files from the Web

Need to fetch a file directly from a URL? wget is your command.

wget https://example.com/file.zip

Great for automating downloads in scripts.

18. tailView the End of a File

Perfect for monitoring logs in real-time:

tail -f /var/log/syslog

Add -n to control how many lines you see:

tail -n 20 logfile.txt

19. dfCheck Disk Space Usage

Running low on space? df shows you the breakdown.

df -h

The -h flag makes it human-readable (think GB and MB instead of raw bytes).

20. psView Running Processes

Want to see what’s running on your system? ps reveals active processes.

ps aux

Add | grep to filter:

ps aux | grep python

Final Thoughts

Not quite a command but a tool preference. Over the last year or so, I have switched over from iTerm2 to Warp.dev.

It is a gorgeous AI-driven terminal, clean interface, and with command+i you can use the GenAI prompt to explain errors, or even use agent mode to have it do complex stuff. Worth checking out!

As the legendary developer Richard Stallman once said, “The command line is not a step backward. It’s a step sideways—a shift in how you think about control.”

So go ahead, fire up your terminal, and start experimenting. Every command is a step toward mastery.