39
submitted 1 month ago* (last edited 1 month ago) by arty@feddit.org to c/linux@lemmy.ml

Over the decades I’ve seen the praise and critique of the "Unix way". I don’t remember reading about the aspect I’ll describe below. This might be a banality, and I haven’t invested much thought into it either. I’m just curious to hear your opinions.

At the core of the Unix way is that tools should do just one thing. Users very often need results that can only be achieved after doing several things. With only single-purpose tools at hand, users have to integrate them. In other words, the tool authors delegate integration to the users.

Here’s the idea I want to discuss. In programming languages, integrating various modules to achieve a goal is already a complex task because we often have to handle numerous failure modes and edge cases. In shell scripts this is much worse, since shells are more limited than programming languages. Writing a tool that does only one thing looks like avoiding the most complicated task. Which leads to a conclusion that the Unix way only works well in a rather small fraction of use cases; the majority of cases are better served by different approaches.

What do you think?

you are viewing a single comment's thread
view the rest of the comments
[-] nik282000@lemmy.ca 1 points 1 month ago

For the single case where a user wants to find then delete a bunch of files, the --delete flag makes sense, but having the function of find overlap with the function of rm adds complexity to the codebase of find without matching the feature set of find + rm.

[-] arty@feddit.org 1 points 1 month ago

Remember how I was saying that good integration is difficult? Well, if you just "naively" integrate with rm then you get issues like "too many parameters passed to rm" or "there is a vulnerability if you manipulate filesystem while find is still running". These are among the reasons a well-integrated -delete exists, as "impure" and "complex" as it is.

[-] nik282000@lemmy.ca 1 points 1 month ago

man find tells me that you should be using the -exec flag should be used if you want to do some operation on the files you find one at a time, using man to learn about a tool before you use it is also the Unix Way. (It also mentions the --delete flag as well as the gotchas that come along with using it).

I will agree that for some complicated tasks that a lot of users might want to do a lot of times, for example downloading videos from YouTube, all encompassing tools are are good idea. yt-dlp has hundreds of functions to cover all the things a user might want to do, but even it relies on outside tools like ffmpeg to get the job done.

[-] arty@feddit.org 2 points 1 month ago

You actually support my point by referring to manuals. The manual for find is more that thousand lines of text. Should I read it before first use and memorize all the peculiarities forever? Or should I check it every time I use find to see if there are comments specific to the current scenario? Both alternatives seem complex. Remember how I am complaining about unnecessary complexity? When using an alternative in a programming language I don’t have to bother with all that: I get a file handle and pass it to delete method.

Many commenters on the internet say "you should read the manual". I doubt they follow this advice. I won’t take you as an example because you claimed no expertise. But whenever someone says these words, ask them to compare find -delete and find rm without looking into manual, see what they say.

this post was submitted on 25 Oct 2026
39 points (95.3% liked)

Linux

69022 readers
350 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS