The Linux Thread - The Autist's OS of Choice

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
Big part of why I learned Python was to get away from having to learn how to pipe things through grep and awk. I acknowledge powershell is strong, but the syntax scares me of it, and Python is pretty strong too, not super slow to write scripts in, and I’m already good at it, so I see no reason to learn something else. Especially considering powershell is unlikely to ever make it to macOS, which is what I prefer to work in anyway.
It's been available on MacOS X for about as long as Linux. Admittedly, only in the .Net core based version, which is just now (as .Net core reaches critical mass) getting back to the kind of ready extensibility from just reusing existing .Net dlls that the Windows-only .Net Framework based version did a decade ago.

I like powershell because it makes it easy to create dirty as scripts that can easily sort and filter complex data from more than just plain text files, and if you have to come back to it in a year, unless you are completely retarded, even if you've completely forgotten how you would need to write the logic, and you created it by manually single-stepping through things and copying shit off SO, you can just readily understand it, rather than having to rederive everything from first principles?

@Overly Serious shouldn't that be if (myValue -eq $null) ?
 
  • Informative
Reactions: Susanna
I don't know what's 'very synthetic' about it.
It is an arbitrary "problem" divorced from any actual concrete business case. What is profitable about this problem? "A year ago" highlights the synthetic nature. Evidence that you're trolling here comes from the fact that you argue against a "365 days" case someone else wrote. That's troll behaviour. "So and so had this problem and was willing to pay me to provide this dataset for him." -- this is how a real-world problem looks, which none of this addresses.

the comparison is based on what the OS has
Bruh. There are Linux distroes WITHOUT find and grep, or with busybox's retardo versions. PowerShell used to be a "feature" that can be uninstalled in Windows just like Ruby can be uninstalled on Linux. At any rate, a Ruby install is probably a small fraction of the size of PowerShell. You refuse to see the parallels. Just like a troll.

whilst I've never used Ruby that looks rather clunky. It's opening every file and reading every line
Idiomatic Ruby. It is quite performant in practice. You're whinging about parameters you don't understand. Just like a troll. Even if it is slower, so what? What are you trying to accomplish? Indulge your masturbatory fantasies about the "superiority" of PowerShell when the reality is that the Ruby solution, supposing it is slower, isn't really all that much slower? Dealing with the real humans on either end of this problem, were it real, will take more time than you'd ever save.

I don't know why you would do that.
Noob behaviour, pointing at your arbitrary and synthetic "problem". If you're actually trying to resolve a problem, you'd explain the problem you're solving. But no, you're trolling. Does Microsoft pay you somehow? Do you own Microsoft stock? You're continually missing the point, and HARD. Just like a troll.

Pipelines are a basic element of Bash so I don't know why you wouldn't pipe something from find to another command.
Because in your retardo PowerShell world, you don't seem to grasp that a bash pipeline is an emergent phenomenon used to couple arbitrary systems, in this case, a smattering of various executables which may or may not exist on any given Linux, and may have different features. Pipes have overhead. In the retardo Powershell world, there's probably pages of memory dedicated to all the auxiliary objects holding information in addition to whatever you're actually processing. Pipes? Linear arrays of bytes. That's all any of them ever see. Fundamentally, pipes just redirect file handles. Your Powershell bloatware involves so much more.

the entire Windows OS exposes itself as objects
No, your .NET installation exposes the Windows OS as objects. You used to be able to purge this bloat from Windows. You can't even get your accent on the right syllable here, troll.

At any rate, you're so far off the mark here that there's a separate tool to find, "locate", which maintains databases of files, to make find invocations faster. And likewise, if you're planning to be searching a database of files for a term, there are data structures that make this even faster.
 
  • Agree
Reactions: 名無し
I'm still just using Debian on my server.
If you're ever looking for some changes and it suits your use case give Proxmox a look, it's fantastic. You could set up a Debian VM in there for anything you need it for as a sort of familiar ground/"main" host then start playing with containers fucking everywhere. 8.1-2 is a beast.
 
Yeah alot of weird shit broke with Plasma 6, night filters still shit themselves if you plug in or unplug an external monitor.

There was also a brief bug between P6, X11 and powerdevil where the lock screen wouldn't actually show up either. It would just go completely black with only your cursor visible, though you could still input your password. After unlock the device and return your desktop display 10-15 seconds after that. It's beyond retarded something as simple as that wasn't tested before it was released into the main repos
 
  • Thunk-Provoking
Reactions: jeff7989
I used to like Plasma, but Cinnamon just seems more stable and still pretty feature rich
 
why bother reply at all?
I'm bored before hitting the sack, on the toilet or have nothing better to do so I read your conclusions from the end. Use this as practice for convincing people without walls of text. I have no deep love for either bash or powershell, they're just useful tools for automation.
File system operations are one of the largest bottlenecks in most tasks, beaten out only by network operations
If the bottleneck is accessing files then it doesn't really matter if you write it in Powershell or hand-code it in C

When using those shells I have never had filesystem operations as a bottleneck. I have never had to process so much data at once that an nvme was too slow to keep up. I don't use tens of gigs sized txt files for my notes and I don't handle my media collection with shell scripts on either Windows or Linux. There's much better tools for that sort of thing that I don't have to make myself.

If you have such a large amount of files that just reading them is your bottleneck, do you even have enough RAM to load them all in memory? Won't you have to slow down a bit and do processing for all that large amount of data anyway? I'm actually very curious what situation you've found your nvme to be too slow for your needs.

You know where people usually have so many files? A media collection, but then you likely do post processing or metadata gathering, which are both going to slow you down a lot more than the filesystem operations, or some sort of knowledgebase for which you'll probably use some form of database so you save even more operations by not having to read the files at all. Elasticsearch is powering tube archivist and there's people with millions of videos who can search through all that metadata(including an insane amount of comments) almost instantly to find what they need.

Also, your C code will be fully compiled to machine code though, which is always an advantage if maximum performance is what you want. If you also want others to use the software, better use an actual language.

Seeing as you are unwilling to compare Powershell with Bash
I'm happy to talk bash vs powershell, you just write way too long for the silliest of things and bring up unrealistic arguments. You had such a long post to conclude that "this bash code processes the files one by one and executes an extra redundant filesystem call with stat". See what I mean? I reduced that to a single sentence, and it's essentially what you were arguing.

You could avoid the stat by saving the timestamp from find(or locate/mlocate for even more performance) in an associative array for each file, then going through the array and run grep on them. Based on the result display their time, e.g with timestamp["/path/to/file"] and it would be basically identical to the powershell version in terms of number of operations.

You really want the files in memory for whatever reason so you process them in bulk only after they are all loaded? You can do that. Have another associative array with contents["/path/to/file"] = $(cat "/path/to/file"), then go through that array, do your searches, and display the timestamp from the other associative array. Since find gives you the same metadata as powershell's object, the only other file operation is cat, then you can search in memory through the entire array

Powershell has more complex things like objects and methods to work with them, but they're not just magically there, there's still code behind them that does this. You said somewhere about mtime being bad because "but how do I know how many days are in a month", well in PowerShell you run a function that's already there. You could just write this same function in bash, or C and run that with bash, and boom you have identical functionality! Something is missing? You can make it yourself, that's the beauty of Linux, it's all open and if you really want to you can change anything.

I'd have a much easier time agreeing with you if there was an actual practical example rather than just these theoretical low level things. The truth is that the best shell/language is the one you know and that can be used for your purposes/on the machines you need them to be used. If you can find a problem, someone likely already found it before you and found a solution as well.

what your point of contention with in comparison to "an actual programming language
I'm not here to give any big own to powershell. Like bash or any other tools widely used today, it's a solid tool that can do quite a lot of things. However, if you're already using a programming language daily it's much easier to not have to use hyphens for function names, switching to -gt instead of >, Where-Object { condition(also having to use $_) } instead of object.Where(condition) and a lot of these tiny syntactical differences that make it different from programming languages.
 
  • Like
  • Agree
Reactions: analrapist and 419
You could avoid the stat by saving the timestamp from find(or locate/mlocate for even more performance) in an associative array for each file, then going through the array and run grep on them. Based on the result display their time, e.g with timestamp["/path/to/file"] and it would be basically identical to the powershell version in terms of number of operations.
I will point out that stat() on a file recently accessed is pretty much free as it's going to be in the dentry cache or worst case in the block cache.
Which means there's little resaon to even worry about it until, as you said, you're dealing with way more files than you'd probably be running grep on anyway.

Actually, I just did a quick C program to stat(/etc/passwd) 1,000,000 times. It took 0.744s real, 0.240s user, 0.467s sys.
So, basically free.

Python3 loses big here.
real 0m1.392s
user 0m0.960s
sys 0m0.432s

Nearly half the speed. But oddly nearly the exact same sys time. Oh, wait, that's not odd at all.
 
  • Like
Reactions: Marvin and 0gh
"*.*" as a search query on Unix will not return files unless there is a period in them.
That depends on what sort of pattern matching you're using. If I do locate -r '*.*' it's apparently considered a malformed regular expression and doesn't match anything. Without -r it does regular globbing and performs like you said.

I have recently switched to Linux only to have these issues.

Fonts are blurry and hollow. IMPORTANT
touchpad goes too fast.
Scailing is off when set to 100, which looks like zooming out 200 percent on a Windows browser. If I zoom in, it's too much, and if I zoom out, it's too little.
no gestures im on KDE and theres no proper 3 finger swipe gestures just poor imitations of Macos

fix these

To start with, what sort of display are you using? Also, you should be able to search in the applications menu for something like "Mouse and Touchpad". (Granted I'm using Xfce4 here but KDE should be similar.)
 
Last edited:
  • Agree
Reactions: analrapist
MX Linux is the most popular distro according to distro watch and others. I was looking at LMDE but that's still a slideshow for the main Ubuntu based Linux Mint, while MX Linux is Debian directly with key changes like systemd being replaced with something competent. That may actually be a better os to introduce people to Linux.
 
DistroWatch doesn't measure what distro is most popular, it measures what distro is looked up on DistroWatch the most. The most popular distro is Ubuntu by some considerable margin, it's what 99% of students install when they're told to get a Linux VM for their intro to programming course etc.
 
I have recently switched to Linux only to have these issues.

Fonts are blurry and hollow. IMPORTANT
touchpad goes too fast.
Scailing is off when set to 100, which looks like zooming out 200 percent on a Windows browser. If I zoom in, it's too much, and if I zoom out, it's too little.
no gestures im on KDE and theres no proper 3 finger swipe gestures just poor imitations of Macos

fix these
What display, graphics card, and distro are you using?
 
i did consider everything but i was misled about KDE
KDE Plasma was fine throughout most of 5, in my experience. It's only now that 6 has dropped that it's become an absolute bug-ridden mess again.

Having said that, it has updated for me earlier today, so here's hoping some of the bugs I've had with it might have gotten fixed.
 
I found myself needing a program that has odd dependencies and I decided to try and install it through the nix package manager for a change, as opposed to the usual side repository or, Linus forbid, flatpak. Here is my literal first impression.

  • Try nix search $package. It tells me nix-command is an experimental feature (search is fucking experimental? What?)
  • After digging through --help and manuals, I find another way to do the search.
  • nix-env --query $package, as I should be writing it according to the manual that came with my latest install of nix, gives me no matches on the package that is listed on nix's website.
  • The Internet tells me it's actually nix-env -qa $package, but neither of these fucking flags are in man nix-env. Losing my brain cells at this point.
  • The query takes a literal minute, dnf and apt eat your hearts out. It does work, however.
  • The Internet now tells me that nix-env -qa is discouraged and should be slow. It also tells me that the proper way is, indeed, nix search $package.
  • I bite the bullet and start doing it the intended way. Try number one: nix --extra-experimental-features nix-command search. It now complains about a missing flake.nix.
  • Apparently, to search for a package in the nixpkgs repository, I need to be using flakes - another experimental feature.
  • The actual command is now nix --extra-experimental-features nix-command --extra-experimental-features flakes search $package
The autism necessary to construct this during development hit me like a wave and I felt compelled to make this post. Jesus fucking Christ, this makes systemDicks look like suckless software :story: Never again will I talk shit about man pages of standard Linux utils.
 
He dual boots Linux and Windows, even uses Visual Studio (a Microsoft-produced IDE) and is arguing that Microsoft Powershell is "functionally superior to Bash and infinitely more consistent". I don't necessarily agree but most of that was stated within the first (technically second) paragraph.
powershell is an alright scripting language for most applications, but bash is so much more powerful. one guy even wrote a minecraft server using it.
it honesty depends on your use case.
mainly use windows? powershell.
mainly use linux? bash.
 
Back