AnnouncementsMatrixEventsFunnyVideosMusicBooksProjectsAncapsTechEconomicsPrivacyGIFSCringeAnarchyFilmPicsThemesIdeas4MatrixAskMatrixHelpTop Subs
3

I will begin to document my gripes with GNU/Linux. This is a critique of the design of Unix systems in general, and shouldn't be read as fanboying for either Windows or macOS. I do think macOS is a wonderfully designed system, and that GNU/Linux should aim for its level of user friendliness, but that isn't the point of this series that I'm going to start. My aim is simply to point out shortcomings.

The first one is that the syntax of various commands is such that a tiny mistake can cause a lot of destruction. Take mv, the move command. Its regular use is mv file1 file2 ... dest/ to move file1, file2, and the other files listed into the directory dest. Okay, that's great. But the command can also be used to rename files while keeping them in the same directory. And this operation may overwrite an existing file. And if it does, there will be no confirmation. So if you write mv file1 file2 and then accidentally press enter, file2 is gone, it's now overwritten by file1. Great. Have you ever accidentally deleted files while trying to move them inside Windows Explorer (or any other graphical file explorer)? It's very difficult to do. Yet using the command line has to be equivalent to playing with fire, for some reason.

This can in fact be avoided by using mv -t dest/ file1 file2. With the -t option, you specify the destination first, so a premature enter won't overwrite any files. But this isn't the default way of using the command. People aren't taught to always do this. I only found out about it just now. Don't make the default syntax ambiguous between moving files and destroying data.

A similar problem exists with rm. What happens when you delete files in a graphical file explorer? They are moved to the trash bin, and you can restore them. Not in the CLI. If you rm something, it's fucking gone, man. There's a utility called trash-put, but once again it isn't the default. You have to install it from the repos, and then get used to typing that instead of rm, or perhaps make rm a function that calls trash-put. But if you do that, and you keep on writing rm, and then at one point you're on a different system, you will write rm expecting it to put the files in a trash bin, when in reality it destroys the data. So you should probably write trash-put if you're gonna use that utility. But then when you're running a script or pasting commands that include rm, it will still destroy data. As you can see, a lot of headache is caused by bad defaults. Make use of trash bins.

I will write these as short chunks one at a time so this will do for now.

Comment preview

[-]x0x70(0|0)

This is a reason why if I delete a directory the -r or -rf goes last. That way if you are typing out rm -r /etc/sshd/authorized_keys.d a premature enter can't delete all of /etc. The -rf at the end then acts like a signiture signing off on it. I recently had an LLM complain to me about that even though it is a pattern more than myself have picked up and is 100% correct.

If you think mv is bad I should introduce you to my drib command, which I also have aliased on my system as d and c. It's mv, mkdir -p, and cd all built into one. It's meant to avoid the repeditive sequences of commands we do. mkdir graphic; mv *.png graphics; cd graphics. Now it is just c *.png graphics. Or if you don't have any files to move (and move yourself with them). You can start a new folder and travel to it with c newproj.

Point is though it is even less explicit, does more things, and is more dangerous. But it otherwise it does suck typing a directory three times just to make it, move files to it, and go there. I have it occupying such a short letter because it is supposed to fill in for cd when there is only one argument.

[-]LarrySwinger0(0|0)

I recently had an LLM complain to me about that even though it is a pattern more than myself have picked up and is 100% correct.

Under GNU it is, and I agree that it is good practice. Interestingly, you cannot arbitrarily put options at the end under the BSDs.

drib command

I wrote a script called ws which stands for workspace, which does a similar thing: utilize directories under $HOME/ws/ and quickly switch between them. Although it adds files via hardlinks / symlinks. (I sometimes avoid moving files because it breaks all links to it within documents, and that is another thing about linSUCKS that sucks, but this is a spoiler warning for a future installment.) You can find the script here.

[-]beenPoisoned0(0|0)

OS X is FreeBSD. its all 60s and 70s magic.