What are the actual benefits of using terminal?
What are the actual benefits of using terminal?
You can perform certain tasks in a more efficient manner.
One is that that you can run a lot of programs with a lot of options quickly (without having to work through a huge randomly arranged UI that has no search for its own functions), and on collections of files defined by patterns or filters.
Speed and productivity
Writing scripts is easy for repetitive tasks
Command line applications are composable. Ie, you can put many of them together to accomplish larger goals, without needing to manually interact with a bunch of GUI apps along the way.
The other day i downloaded a manga and for some reason every chapter had a lot of random symbols after the .zip.
I checked if i could fix it just by fixing the extension and it worked.
If it wasn't for a quick batch script, i would have had to rename every file manually.
You're not tied to graphical interfaces and their constant fuckups, CLI tools are mostly standard (even more so since systemd took over) and you can assume they're available everywhere
>b-but I use VVindovvs
Kill yourself. Use Powershell as a rope.
I like it, but you don't have to use it if you don't.
>need to fix something in Windows
>have to go into Control Panel and hunt through approx. 50 million layers of popup windows, tabs, obscurely named buttons and hidden 'advanced options' checkboxes
>or I could type one line into a console
Languages are far more efficient than GUIs when it comes to representing information.
kek
I remember when I had to do that once but I didn't give enough of a shit to begin with and never ended up doing that.
What commands would be used for that? Sed/grep?
You can do it just with "mv" and bash / zsh regex, rename(1) or something else.
If you prefer to do a sed / grep manipulation of the string name, that works too.
That is when you know exactly what you are going to do. If you don't and if you are searching for options reading 100 page long manual is way harder than browsing through popups.
to be fair, you can use automator for that on OSX without touching terminal.
Just more efficient for some tasks, especially after you've learned the tools you'll need for such tasks. Good GUI tools can be efficient, too, of course.
Like if there's a thing you only rarely need to use, in a (well designed) GUI environment you'll handle it every time without checking what to do, with CLI you'd probably be googling or at least checking a manual, maybe every time you use said thing.
I can't remember how many times I've needed to check how to use wget, since I don't use it for anything complicated very often, for example: if I had a GUI for it with check boxes for the options, it'd be faster to use every time I use it for something specific
However, if it had no CLI option, it would be harder to use as part of other terminal work.
yeah except for things where a GUI just isn't going to ever be efficient, think ffmpeg args
Every time you log in from somewhere else you're supposed to .. what?
Well, there's doing shit remotely, doing complicated shit (eg, big text-processing job or doing shit like automated file conversions based on filename), and of course, batch jobs.
Remote shit is simple -- sshing into a machine to quickly configure things is pretty nice vs using a whole heavyweight vnc/x11 setup, and good luck getting that far if the machine is having issues; if you have a webui, it's certainly going to be missing things
complicated shit is because you can chain together programs and script it all, with GUI tools, you'd either manually click around for each task in sequence or (if the tool you used supported it) record a macro
batch shit is obvious and see the bit immediately above for why
There's no reason to always use the cli over gui tools, but there's actual, valid reason the cli continues to exist.
Go look for rename. Example, I have a bunch of files that have -DownloadedFrom4Chan to the end of the file. Then I'd use a regex with rename:
rename 's/-DownloadedFrom4Chhan//' *.pdf
You can use rename -n to let rename show what it will do before renaming shit. If you'd repeat the above command with -n, it will show old and "new" (planned) filenames.
Yeah, I wrote my own custom perl thing for it. Dropping regex input/output to pipe into other commands. It's fugly.
tl;dr
CLI has the advantage of being quick, versatile, scriptable and efficient when you know what you're doing.
GUI has the advantage that if done properly, it can be figured out on the spot.
These do not apply for all tasks and purposes, but generally, when a CLI is preferable, it is due to that reason.
And when GUI is preferable, it is either due to that reason or due to the nature of the task being a graphical one. For example, advanced image editing can't be figured out on the spot, but it would obviously be pretty horrible to try to edit images without graphics and graphical tools.
nice blog
perl is basically regex: the language, if you need anything nontrivial you might as well do that instead.
>perl is basically regex: the language
Then why is it so horrible at it?
(Note the logarithmic scale)
Because nothing else implements regex as deep as perl. PCRE is a COMPATIBLE and not equal subset of Perl regex.
I think you missed the entire point of my chart.
oh and awk/tcl/grep aren't even on the same level of regex, that's the oldest unix compatible regex. Doesn't even belong in the same class.
Perl is doing a lot more with that time, it's not fast but it's literally regex: the language.
the benefits of using a terminal are absolutely endless
instead I'll say a couple things about the gui. First of all, all a gui is, is an extra layer/multiple layers between the user and his task. On the cli you can perform anything on a file for example, with a gui, you need to find the right gui to complete whatever task you're trying to do. All guis behind the scenes are just performing cli actions in the background anyway. You need tons of them open all at once, in order to multitask the same way you would in a single terminal session, even without multiplexing. I mean, just ask /o/ what are the benefits of using a stick instead of automatic. Its simple, the terminal/stick shift gives the user power, control, and flexibility, which are otherwise absent. Also, it looks and feels a whole lot better.
Perl does things that are not regular. It's more powerful than a normal regular expression.
You may think this is a good thing, but it's not. It takes a massive dump on the CS theory behind regular expressions, and what actually made them good in the first place.
Real regular expressions scale polynomially in the worst case, perl """regex""" scale exponentially.
Even with somewhat small inputs, perl will literally be billions of times slower than grep and that.
Anyone who thinks perl regexes are good clearly know nothing about regular expressions.
Depends on the level of power you need out of your regex doesn't it? If unix regex isn't enough then it can't be considered "good" for that task.
Speed isn't the only measurement of regex, actually getting shit done is a better metric but even at that point everyone knows perl has gone too far and nobody copies it. This is why when you need advanced regex with not advanced speed you use perl and nothing else.
for i in ?*.zip?*; do mv "$i" $(echo "$i" | egrep -o '^.*\.zip'); done
Showing off your epeen
Fast if you know what you are doing.
Pretending you're better than other people by using a completely and totally obsolete technology. This and config file editing bullshit.
you get to look 1337 as FUCK
>pretending you're better than other people by using completely and totally obsolete bait
For some reason, sometimes you can't update your system with non-cli tools.
That''s just an optimization problem, the regex was written in an obviously inefficient manner. Perl/Python/Ruby all use a superset of "real" regexp. It means that they're more powerful but also harder to optimize. Clearly the authors decided that there wasn't a need to optimize against almost certainly deliberately written inefficient patterns.
>google "how do I x"
>find utility
>man utility
>never have this problem again
yeah I can see why retards need pretty pictures rather than reading a few paragraphs of text.
I think this is because PERL regex supports lookaround, while the others don't. (Or at least, not the versions used for the graph.)
you look cool while using one
If only there was a better way to navigate the builtin manpages. apropos and whatis are only good if you know roughly the name of what you're looking for. if there was an offline google for searching through the content of man and info pages, I'd be set.
have you ever used xman? It is pretty decent for just browsing manpages.
you can literally just type xman into a terminal, most install of x11 will include it, or you can pull it from any repo your distro has.