So, what is the advantage of using the terminal?

09 Oct.,2023

 

I was just answering a similar question like this the other day. It turned out this person never used keyboard shortcuts to do anything, so it turned out to be a long discussion. I hope you have some familiarity with those...it would make my points more understandable.

Consider using a word processor. If you save a file, you might use a keyboard shortcut like ctrl-s. Someone might say, "I prefer to use the menu. It doesn't save me much time to use the shortcut. And if you have to save a new file you have to navigate through the file system to the directory, and then type the name anyway." So this objector is correct that each keyboard shortcut by itself does not save a significant amount of time. The true savings is in chaining shortcuts together, e.g. select all, cut, paste. Even the word processor makers have realized this and made it more convenient to access the file structure using the keyboard, e.g. being able to access recent folders/locations using tab and arrow keys.

Of course selecting pieces of text requires the mouse oftentimes... this is why programmers and people that do a lot of editing prefer to use a text editor that supports full keyboard use so you never have to use a mouse. Not only is the mouse slow, but it is prone to errors -- it is particularly easy to select or delete the wrong text.

Now what does this have to do with the command line? An advantage of the command line is that it avoids using the slow, error-prone mouse. Instead, you type and you do it from one location; you don't have to be looking around for another menu or clicking over there and then over here. It's the same reason people like using web browser keyboard shortcuts (to open new tabs/windows, to use Gmail, etc.); they're going to have to type the URL (or email or whatever) in anyway...why move your hand away from the keys?

But most importantly, just like keyboard shortcuts are the most powerful when you start using them all together (rather than just one or two), you can chain commands together to do more powerful things that would either take forever through the GUI or you couldn't even imagine doing at all. For example, from the command line, you can tell your web browser, I want to keep refreshing this webpage every 30 seconds, look for a certain text and when that happens, send me and a group of contacts an email saying that text has appeared on the webpage. As another example, you can tell your computer, I want to look through ALL the emails I ever wrote, look for a reference to this particular book, produce a list of dates I've mentioned this and who to, order the list according to frequency, and put it into this email I'm typing now.