Comment on Windows 11 24H2 goes from “unsupported” to “unbootable” on some older PCs
barsoap@lemm.ee 8 months agoFrom cat to grep to cp and dd and many many many other redundant tools that exist in the system.
…redundant with what? Sure, instead of grep
you can use sed -e g/re/p
: First came ed which can do the same but requires the whole file to be loaded into memory so grep was written as a way to search through files ergonomically and quickly. Quite a bit later came sed to do more complex operations on files in a streaming manner: Sed is for streaming editing, ed is for interactive editing, they happen to share a common vocabulary but really are made for different things. grep knows exactly one word from that vocabulary and applies it to multiple files in a single command, something that’s not really suitable for the editors.
Can’t think of anything that’s redundant with cp, unless we leave the terminal. dd and cat might have some overlap but only if you combine cat with shell redirection. I’ll freely admit that dd is a hell of a wart, though, it is so damn ancient it predates unix command line option conventions.
Today we have far too complex systems to just expect people to work by making a pipe with 5 tools lined up to achieve something a single click in menu can do.
No. The way it usually works is that an end-user makes a click and things get handled by five different tools, completely behind the scenes. Power-users then can come along and customise that stuff as they wish.
MeanEYE@lemmy.world 8 months ago
That’s the whole point, you are not suppose to use
grep
ifsed
works. You are not suppose to usecp
ifcat file > new.file
works. That’s the “UNIX way”, which is stupid ascp
brings a lot more features when it comes to files. Back when that “rule” was inventedcat
only printed files on screen or piped them through. Nothing more. Today you can do all kinds of things with it and to be honest am happy that there are multiple tools doing the same thing. Grep is fine for some things RipGrep and SilverSearcher for others. Am not going to handicap myself or wait for 16h forgrep
to finish digging inefficiently through files because someone said I had to do things “UNIX way”.It’s time we get rid of old ways and embrace modern computing, up to a point where people started building note taking applications in whole web browsers.
barsoap@lemm.ee 8 months ago
No. You
grep
if you are searching for something. Yoused
when you’re editing a file in an automated manner. You usecp
if you copy a file.cat foo > bar
is not, in the very slightest, idiomatic, and never was:cat foo bar > baz
is and that’s precisely whycat
is named like that, quoth the man page: “cat - concatenate files and print on the standard output”.cp
can’t do that. If you usecat
with a single argument then without redirection, as the equivalent of DOS’stype
.Don’t think of “one thing, and one thing well” as “there must be no overlapping features”, but “every program has a clearly-defined use case”. If it can be used for something else, like single-argument cat, then that’s fine, but that doesn’t make cat the program to use when copying files.
And it means “there must be no overlapping features when combining random programs in arbitrary ways” even less: Your
cat foo > bar
uses two programs,cat
andsh
. If the combination between multiple programs was restricted to not have features available elsewhere then you wouldn’t get any of the benefits of being able to combine programs, this explosion of possibilities and with that approaches is precisely the advantage of combination.Never heard of silversearcher, but ripgrep is a straight-up grep replacement. Grep is 50 years old, ripgrep takes 50 years of experience people had with using the original to design a program that fulfils grep’s purpose even better. There’s no council of greybeards saying “there already is a program like that you shall use, we can’t have two programs doing the same thing”, that’s not Unix but python.
I tend to agree. I use nushell, haven’t really gotten into ripgrep I probably just don’t grep often enough to care. My editor is helix which breaks in may ways with the line that started with ed but keeps the core philosophy intact, nay, adheres better to it because it was bold enough to get rid of hysterical raisins. As ripgrep it’s an iteration of the same core idea and principles of an old program, in the light of 50 years of experience people had using it.
You could also combine a text editor and maybe pandoc.