Apps and files — what "open" actually means
This lesson is short because it’s mostly about un-learning one thing.
When you double-click a file — a photo, a PDF, a song — it looks like the file sprang to life. The window appeared, the music started, the document scrolled. Easy to assume the file did that.
It didn’t. The file is bytes on a disk. It’s not capable of doing anything.
What actually happened
When you double-clicked, your operating system ran a tiny play in three acts:
- Look at the file. What kind is it? (A photo? A PDF? An audio file?)
- Find an app on your computer that knows how to read that kind of file.
- Launch that app, hand it the file, and let the app show you something.
Open the same .jpg and Photos starts. Open the same .pdf and Preview or Acrobat starts.
Open the same .docx and Word starts. The file didn’t change. The app changed.
One file, many apps
You can usually open the same file in more than one app. A .jpg opens in Photos by default,
but you can also open it in Photoshop, a web browser, or a text editor (it’ll look like
garbage, because text editors don’t speak JPEG).
This is why “Open With…” exists in the right-click menu. The file is the same. You’re just picking a different app to read it.
Why this matters for the terminal
In a graphical interface, you click a file and an app opens. In a terminal, you do the opposite: you launch the app and tell it which file to read.
Same play, different order. Once you know which app you want and which file you want, the terminal version is faster, scriptable, and works on a thousand files at once.
That’s the whole reason terminal users seem fast. They’re not magic. They just skipped the “hunt for the file with the mouse” step.
What’s next
If files don’t do anything, but apps do — what is an app, exactly? Turns out, an app is also just a file. A weird one. That’s next.