linux

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

bizdelnick, (edited ) in My First Regular Expressions

It is a great book, although a bit outdated. In particular, nowadays egrep is not recommended to use. grep -E is a more portable synonim.

Some notes on you script:

  1. You don’t need to escape slashes in grep regex. In the sed s/// command better use another character like s### so you also can leave slashes unescaped.
  2. You usually don’t need to pipe grep and sed, sed -n with regex address and explicit printing command gives the same result as grep.
  3. You could omit leading slash in your egrep regex, so you won’t need to remove it later.

So I would do the same with


<span style="color:#323232;">tar -tzvf file.tar.gz | sed -En '/.(mp4|mkv)$/{s#^.*/##; s#.[.*##; s#[^a-zA-Z0-9()&-]# #g; s/ +/ /g; p}'
</span>
SpaceCadet,
@SpaceCadet@feddit.nl avatar

nowadays egrep is not recommended to use. grep -E is a more portable synonim

Not directed at you personally, but this is the kind of pointless pedantry from upstream developers that grinds my gears.

Like, I’ve used egrep for 25 years. I don’t know of a still relevant Unix variant in existence that doesn’t have the egrep command. But suddenly now, when any other Unix variant but Linux is all but extinct, and all your shell scripts are probably full of bashisms and Linuxisms anyway, now there is somehow a portability problem, and they deem it necessary to print out a warning whenever I dare to run egrep instead of grep -E? C’mon now … If anything, they have just made it less portable by spitting out spurious warnings where there weren’t any before.

bizdelnick,

GNU grep, the most widespread implementation, does not include egrep, fgrep and rgrep for years. Distributions (not all, but many) provide shell scripts that simply run grep with corresponding option for backward compatibility. You can learn this from official documentation.

Also, my scripts are not full of bashisms, gnuisms, linuxisms and other -isms, I try to keep them portable unless it is really necessary to use some unportable command or syntax.

SpaceCadet, (edited )
@SpaceCadet@feddit.nl avatar

GNU grep, the most widespread implementation, does not include egrep, fgrep and rgrep for years. Distributions (not all, but many) provide shell scripts that simply run grep with corresponding option for backward compatibility. You can learn this from official documentation.

It seems you need to read the official documentation yourself. While it’s new information to me that egrep is no longer a symlink, as it used to be a couple of years ago, but a shell script wrapper to grep -E instead, the egrep command is to this day still provided by upstream GNU grep and is installed by default if you run ./configure; make; make install from source. So it is not a backward compatibility hack provided by the distribution.

You can check for yourself. Download the source from ftp.gnu.org/gnu/grep/grep-3.11.tar.gz, unpack and look for src/egrep.sh or line 1756 of src/Makefile. Apparently the change from symlink to shell script was done in 2014, and the deprecation warning was added only last year.

In any case, my larger point is that the depreciation of egrep was a pointless and arbitrary decision that does not benefit users, especially not veterans like myself who have become accustomed to its presence. I don’t mind change, but let’s be honest, most people are not in the habit of checking the minutiae of every little command line utility they use, so a change like this violates the principle of least surprise. It’s one thing if things are changed with a good reason and the users do not only suffer the inconvenience of the change but get to reap the benefits of it as well, but so far I haven’t found any justification for it yet, nor can I think of any.

So if there is a portability problem with using egrep now, it’s a self-inflicted portability problem that they caused by deprecating egrep in the first place.

Also, my scripts are not full of bashisms, gnuisms, linuxisms and other -isms, I try to keep them portable unless it is really necessary to use some unportable command or syntax.

Good for you. Do you want a cookie or something?

bizdelnick,

It seems you need to read the official documentation yourself.

I did. Debian man page, GNU grep manual.

I’m sorry for your loss, however the egrep deprecation is a fact. Of course you can continue using it as a veteran, but it is not correct to recommend this to beginners.

SpaceCadet, (edited )
@SpaceCadet@feddit.nl avatar

You are strawmanning, and your links are not countering any point I made. I never disputed the depreciation as fact, and I never recommended that beginners should use egrep over grep -E

I disputed your claims that the egrep command has just been a distro hack all these years, when in fact GNU to this day still distributes egrep through its source tarballs and only very recently started to warn about it through the wrapper script. And again, the only “portability problem” here is the fact that they deprecated it in the first place, i.e. a self-inflicted one.

Then as a Linux and Unix veteran I gave my subjective opinion by lamenting and criticizing the fact that this depreciation happened, and how changes like this always feel like unnecessary pedantry to me. Yes it’s an expression of frustration, but I am allowed to feel frustrated about it. I don’t need people like you invalidating how I feel about breaking changes in software that I use daily.

ReluctantMuskrat,

Good for you. Do you want a cookie or something?

I don’t know about that guy but you need a chill-pill dude.

SpaceCadet, (edited )
@SpaceCadet@feddit.nl avatar

Well he wrote it like he wanted to be applauded for it or something.

I also find the irony of your comment extremely funny … although that’s probably lost on you.

Later, dude.

Nachorella, in Promoting Linux: An End-User Manifesto

I have just started trying to use Linux and I find it very hard to actually recommend it to anyone. And the problem isn’t really anything mentioned in the video, it’s just that the UX is not great. You have to google so much to get things working and the answers are almost always typing some cryptic stuff into the terminal. I am technically minded enough to get by but Linux ends up feeling more like a hobby to me rather than something I can actually get work done in.

That said, I really like Linux and am gonna stick with it. I just don’t don’t see it being widely adopted until it becomes a bit more straight forward.

juli,

Beginners usually do not have to do anything in terminal to adjust the system. Which desktop environment?

There isn’t one united linux user frontend - would be cool if you’d state which one is not great.

I assume you talk about gsetting commands?

Nachorella,

I have tried quite a few now. Fedora, Mint, Debian - none could detect my wifi card so I had to go do a bunch of googling to try and get them working, found what driver I needed but was never able to actually find out how to install it, other than some terminal commands in forums that didn’t end up working. I stuck with Endeavour OS because it detected it without any problems.

I have a keyboard that I configure with an online tool called via that requires something called hid. On windows it just works but on Endeavour I have to enable something through the terminal.

I have a shared data drive and in order to make it mount when I start the computer I had to go and edit some fstab file?

I couldn’t even figure out how to install a dual boot with with fedora and mint because it asked me about the root and home and swap and boot partitions and didn’t explain how to set any of them up or what they did.

I needed a program for work that wasn’t on a repository and I had to google howw to launch an .sh file because clicking doesn’t work haha. Also through the terminal.

I’m not saying these are crazy insurmountable problems, and windows definitely has some similar things, getting my tablet working was so much smoother on Linux for example. But I’ve had to learn so much more about how my computer works to actually use Linux and I’m just not sure the majority of people will have that patience.

Deckweiss, (edited )

I wholeheartedly agree with you in regards to general lack in UX quality and lack of introduction for new users.

I have mived to use Linux exclusively for about 5 years now and whenever a teammember at work tries it, I have to give advice about once a day because of some cryptic info that has accumulated in my head and they couldn’t find through a 20minute internet search, to solve an endless stream of tiny issues.

It is an OS that I definitely could never recommend to people like my parents, which are by no means tech illiterate.


In regards to the specific point of launching .sh files:

On KDE Plasma I can double click sh files and a popup shows asking me whether I want to execute the program or edit the file in a text editor.

Nachorella,

o, that’s weird, this one might actually just be user error then, haha. I’ll have to try again as I’m also using plasma.

I actually think it might be better for less tech literate people in some cases. Supposing it’s pre installed or they have someone to set things up for them. If you’re just using it to browse the web or write some documents the general experience is pretty good. It’s only when you start trying to do a bit more with it that things get complicated.

Deckweiss,

My father for example needs to digitally sign PDFs. And I mean properly, so that they becomes unchangable.

I wouldn’t say that this is a techy usecase, it is a rather frequent need for any adult in my country.

On windows it is so easy to set up while on Linux there is no solution at all.

So yeah, just browsing sadly wouldn’t cut it.

juli,

I agree linux can be very difficult but easy as well if you do not have “exotic” needs. If more people were using linux, especially more non techies, a lot would change but we’ll get there just slowly.

to respond to your points

I initially thiught you meant that you had to use commands in order to tinker with the UI - that’s my bad!

Wifi card, drivers, etc. can be a real pain. That’s neither linux or your fault. It’s just that noone prior to you wanted to use it and that’s why it wasn’t yet supported. Most systems are just plug and play. - compare it to macos, and you’ll find that linux is easy to install on most systems.

Auto mount is done using fstab right. Yoz xna also auto mount from the file explorer of the disk utility, it always depends on the system. There are a lot of different things and it’s not perfect.

Dual booting is in my opinion something for advanced people. I have no idea why anyone would ever suggest it to a newcomer! It’s pain in the ass if you deviate from the standard protocol.

Xou can double click on a shell script (.sh) by chmod +x file.sh or > right click > properties > exe as program

user224,
@user224@lemmy.sdf.org avatar

Which distro and DE are we talking about?

I have the same issue with Windows. I’ve been using Linux since I got my first PC. Trying to navigate Windows is a pain in the ass. It’s just old programs somehow put together. When I find some solutions online it’s often opening who knows what via Windows+R or better yet, changing something I have no idea about in regedit.
And even the most basic things are hidden away by many steps.

Nachorella,

I feel you, I’m sure a lot of it comes down to familiarity. I just very recently did a fresh reinstall of windows and endeavour in a dual boot. And honestly the Calamares installer is a lot nicer than the windows one. But doing simple things like just writing to a secondary hard drive is a non-issue in windows whereas in Linux it was a whole learning adventure.

user224,
@user224@lemmy.sdf.org avatar

But doing simple things like just writing to a secondary hard drive is a non-issue in windows whereas in Linux it was a whole learning adventure.

What do you mean by that? Are you talking about RAID, having some partitions on separate drive or something else? Because if you mean just using secondary drive for files that’s just as easy as on Windows with most distributions.
Or did you mean installing programs to secondary drive? Yeah… I have no idea how that can be done. By a quick 4 minute search it seems… that it’s a problem.
So yeah, I can see a problem here. So many computers have something like 128GB SSD + 1TB HDD.

Nachorella,

No, just a secondary hard drive. I use it for Windows and Linux so it’s ntfs. I was just trying to save a file to it but it said I didn’t have access, turns out I needed to specify ntfs-3g in the fstab file before I could write to it.

user224,
@user224@lemmy.sdf.org avatar

NTFS is proprietary FS that works on Linux thanks to great reverse-engineering efforts. To make this more fair, try accessing ext4 partition from Windows. Oh, it can’t even recognize it. Except that ext4 is open-source, so it wouldn’t even require reverse-engineering.

That said, have you fully shutdown Windows? You generally get write access out of the box nowadays, but only if Windows is fully shutdown. And clicking “Shut down” does not properly shut it down unless you disable fast startup.
Another method is to choose a “Restart” in Windows, and then instead of continuing with the restart, choose Linux on bootloader screen after you get there.

Nachorella, (edited )

I’m mostly just speaking to the process. I can right click and mount the drive without a problem, but there’s no way to auto mount it on startup without editing the fstab file and finding the uuid of the drive through the terminal (at least as far as I could tell) all of the functionality is there, which is rather laudable, but the process is unapproachable for a lot of people.

O and yea, I did have to disable some fast startup setting in windows to get the write access, I forgot about that. But yeah, that one’s on Windows.

edit: sorry, this was actually pretty irrelevant to what I actually said, which was just about the write access which you pointed out was a windows issue. I got mixed up with my replies.

user224,
@user224@lemmy.sdf.org avatar

but there’s no way to auto mount it on startup without editing the fstab file and finding the uuid of the drive through the terminal (at least as far as I could tell) all of the functionality is there, which is rather laudable, but the process is unapproachable for a lot of people.

I haven’t tested it, but gnome-disks (pre-installed in e.g.: Ubuntu and Linux Mint) does have that option:
https://i.imgur.com/PYZjXiQ.png
https://i.imgur.com/pLJiV2C.png

Nachorella,

ahh, that’s good to know, thanks.

gratux, in Why do you use the terminal?
@gratux@lemmy.blahaj.zone avatar

it allows easy scripting. also for frequently used commands, i can just scroll up in the history, instead if clicking the same buttons over and over

throwawayish, in Flatpack, appimage, snaps..

openSUSE’s Richard Brown has given multiple talks over the years comparing these three. I’d suggest anyone to look at those for a great rundown on how these universal package managers compare to one another. His most recent talk can be found here; in which he actually does some kind of recap as well.

onlinepersona, in Plymouth Linux Graphical Boot Manager Now Better Handles Display Rendering

My experience with the linux boot has never been flicker-free. It’s bugged me for years, but I don’t have the technical knowledge to fix it. There’s a black screen between BIOS and plymouth, then a black screen between plymouth and the login screen, then another black screen between the login screen and the splash screen, and finally a black screen between the splash screen and when the desktop shows up.

Mac and windows do a much better job at having a seamless experience from boot to desktop.

CC BY-NC-SA 4.0

stepanzak,

What’s the


<span style="color:#323232;">?ref=chooser-v1
</span>

in the url? Works fine without it.

onlinepersona,

Comes from chooser-beta.creativecommons.org

Which browser isn’t it working on?

stepanzak,

It works fine for me, it’s just unnecessary argument AFAIK.

MonkderZweite,
rotopenguin,
@rotopenguin@infosec.pub avatar

And the price for that beautiful, flicker-free experience is … some Macs will brick themselves. You can get them into a state where (IIRC) the dual-boot between an older macOS and a newer one (or Ashai) disagree on display modes, and the bootloader dies. Only Apple can fix that.

onlinepersona,

That’s macs. Fuck em. With linux I can always put in a USB stick with a live linux and fix shit.

CC BY-NC-SA 4.0

TimeSquirrel, (edited )
@TimeSquirrel@kbin.social avatar

I usually just disable all this useless eyecandy shit. I like seeing the raw boot messages scroll across my screen. Let's me know early if something is fucked.

ReakDuck, (edited )

I wish Windows (11) would have this. Literally having a broken Windows Partition right now after starting Rick an Morty VR adventure game…

I only use Windows for VR gaming

dingdongitsabear, (edited )

I’m also trying to get the flicker-free boot. switching to systemd-boot improved the jerkyness, but the blank before the decrypt password remains.

I’ve enabled suspend-then-hibernate and whereas earlier I’ve had to endure this jerkyness rarely, now I have to witness it multiple times a day when resuming from disk. at least it’s faster than cold boot.

Molten_Moron, in Cool fancy programs?

No more secrets sounds like it fits the bill

mrpibb, in Redox OS - an OS built entirely out of Rust
@mrpibb@lemmy.world avatar

I’ve used it in a VM just to mess around. I’d like to install it on an old ThinkPad and try to compile some applications.

Yerbouti, in Fedora Asahi Remix Officially Released for Apple Silicon Macs

This is great!! I use macOS for work but I’m sure I can get 90% of the work done on Linux now! Just wondering about GPU perfomance? Video editing is crazy fast on macOS, anyone tried on Asahi?

franklin, (edited )
@franklin@lemmy.world avatar

I know that they only recently got opengl support and it was pretty primitive so I would imagine they have some work to do on the GPU side

Blisterexe,

They have full vulkan now too, but it’s not quite mature enough to be enabled by default rn (afaik)

PrefersAwkward,
@PrefersAwkward@lemmy.world avatar

If they can get full vulkan, maybe Zink can take care of the rest

NamelessGO, in Fedora Asahi Remix Officially Released for Apple Silicon Macs

Great news

glibg10b, in Just moved to Linux: a follow up

borked my bootloader and had to do a fresh install

That’swhere you’re wrong :)

Corr,

You’re right. I spent a few hours trying to fix it before giving up and determined that reinstalling would be quicker lol

glibg10b,

Before you can fix a bootloader, you first need to learn how to install and set up a bootloader. I think most people learn that part when they try Arch

AngryCommieKender,

Do it with Debian Unstable

018118055, in As a normal, boring user that does nothing special other than browse the internet and the occasional "casual coding" -- what am I supposed to do with 32GiB of ram?

Virtualize fun things for projects

bulwark,

Heh, I’ve got 32gb on my Proxmox box, and would be lying if I said I wasn’t eyeballing a few 64 or 128 sticks.

filister,

I second that, install cockpit if you don’t want to bother with the CLI and run a couple of VMs. You can even start 3 VMs and install Kubernetes on them and play with it.

cyborganism, in Poll: GUI framework for widgets/apps in Wayland

I found the easiest to work with to be QT.

rufus, (edited ) in Looking to switch to Linux in the somewhat distant future

Try it with a Live USB stick. And maybe don’t listen to the people recommending Ubuntu. It’s somewhat okay, but they regularly do annoying business decisions that affect their users. I’d rather start with Mint or something.

There are many other websites dedicated to this question:

thespezfucker, (edited )

thats sounds nice, I’ll test it with my Chromebook first (after upgrading my specs ofc)

Secret300, in What are you most excited when it comes to linux in 2024?

I’m excited for convergence and Linux mobile.

Wayland becoming the default for every DE. X11 needs to go.

I’m hoping more market share will mean more applications come to Linux and better support for hardware. Cough cough Nvidia

Bcachefs also looks interesting but I need to look into it more.

And I’m also excited for all the things I don’t know about and didn’t even think about showing up

grendel, in Kernel 6.6.6 is out 😈
@grendel@lemmy.world avatar

HAIL STALLMANSATAN

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #