← All stories

Bash vs Python: Which Should You Learn First for Automation?

You want to stop doing the same boring computer tasks by hand — renaming files, organizing folders, checking things every day. Someone told you to learn Bash. Someone else said Python. They're both right, and both wrong. Here's the honest breakdown so you pick the right one first.

What Bash actually is

Bash is the language of the terminal — that black window where you type commands instead of clicking. (If you've never opened it: on Mac it's the Terminal app, on Windows it's PowerShell or WSL, on Linux it's usually Ctrl+Alt+T.) Every Mac and Linux machine has Bash built in.

Bash's superpower is gluing programs together. The pipe character (|) takes the output of one command and feeds it into the next, like connecting Lego bricks. Need to count how many Python files are in a project? find . -name "*.py" | wc -l. One line, done in a second.

Bash is brilliant at: quick file operations, chaining existing command-line tools, and anything you can already do in the terminal but want to repeat. A script — just a text file of commands that runs top to bottom — turns a 10-minute manual chore into a single command.

The catch: Bash syntax gets cryptic fast. $1, ${var:-default}, 2>&1, [[ -f "$x" ]] — it reads like incantations, not language. For short tasks that's fine. For anything longer than about 30 lines, Bash scripts become hard to read, hard to debug, and easy to break in subtle ways.

What Python actually is

Python is a general-purpose programming language famous for reading almost like English. "If the file is too big, print a warning" is barely an exaggeration of real Python code.

Its superpower is the ecosystem: thousands of free libraries for everything — spreadsheets, PDFs, images, web pages, databases. And it's cross-platform, meaning the same script runs on Mac, Windows, and Linux without changes. Bash scripts, by contrast, assume a Unix-style terminal and often need rewriting for Windows.

Python is brilliant at: anything involving logic (if this, then that), working with structured data like CSV files or JSON, and scripts you want to still understand six months later. The tradeoff is verbosity for tiny tasks — where Bash does it in one line, Python might need eight.

Same task, both languages

Let's make it concrete. Task: find every file bigger than 100MB in your Downloads folder.

In Bash, it's a one-liner:

find ~/Downloads -type f -size +100M

(~ means your home folder, -type f means files only, -size +100M means bigger than 100 megabytes.) Type it, get your answer, move on.

In Python, the same job looks like this:

from pathlib import Path

folder = Path.home() / "Downloads"   # same folder as above
big = 100 * 1024 * 1024              # 100 MB in bytes
mb = 1024 * 1024                     # 1 MB in bytes

for file in folder.rglob("*"):       # rglob = search subfolders too
    if file.is_file() and file.stat().st_size > big:
        size_mb = file.stat().st_size / mb
        print(f"{size_mb:.1f} MB  {file}")

Eight lines versus one — Bash wins this round on brevity. But notice: the Python version is readable line by line even if you've never seen Python before. And the moment the task grows — say, move those big files into dated folders and log what you did — Python stays clean while the Bash version starts sprouting $ symbols and quoting traps.

The learning curve, honestly

  • Bash, week one: thrilling. You learn a dozen commands and suddenly feel like a hacker. Quick wins everywhere.
  • Bash, month three: the wall. Quoting rules, exit codes, and the difference between [ ] and [[ ]] start biting. Debugging means staring at terse error messages.
  • Python, week one: slower start. Getting it set up, learning indentation, writing your first real script.
  • Python, month three: compounding. Everything you learned still applies, the code you wrote last month still makes sense, and libraries do the heavy lifting.

Bash is easy to start and hard to master. Python is slightly harder to start and keeps paying off.

The verdict

Learn just enough Bash to be comfortable in the terminal — navigating folders, pipes, find, grep, redirecting output. That's maybe a weekend of practice, and it makes you faster at everything, including running your Python scripts.

Then invest your real learning time in Python. It's where automation scales: readable scripts, real error handling, libraries for anything, and skills that transfer to data work, web backends, and AI tooling.

And keep Bash in your pocket for the jobs it's still best at: one-off terminal tasks, quick file searches, and gluing command-line tools together in a single line. The two aren't rivals — they're a team. Bash is your pocketknife; Python is your workshop.

Start today

Open your terminal and run that find one-liner above on your own Downloads folder. Then save the Python version as bigfiles.py and run it with python3 bigfiles.py. Same answer, two languages — and now you've written your first automation in both. The boring tasks don't stand a chance.

Join the discussion

Older →Older Post
Older →Older Post