Linux

49964 readers
932 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 5 years ago
MODERATORS
126
23
submitted 2 weeks ago* (last edited 1 week ago) by [email protected] to c/[email protected]
 
 

Hi everyone, I am planning on building a new PC. The only things I'm planning on transferring from my old build are my hard drives. Will I have any problem putting my OS drive with Linux mint right into a whole new PC? My other question is if I use my current Linux OS drive do I have to remove the old GPU and CPU drivers? I'm sticking with an nvidia card but I will be switching from Intel to AMD. I know in Windows you have to use software to fully remove GPU drivers before using a new one.

EDIT: based off the mix of answers, I'm just going to do a clean install to save myself from possible headache. Thanks for the responses!

127
455
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/[email protected]
 
 

Note that DistroWatch is not the only one affected by ban on FOSS related article links on FB.

Further read: https://news.itsfoss.com/facebook-ban-fiasco/

128
 
 

Edit

My question was very badly written but the new title reflect the actual question. Thanks to 3 very friendly and dedicated users (@harsh3466 @tuna @learnbyexample) I was able to find a solution for my files, so thank you guys !!!

For those who will randomly come across this post here are 3 possible ways to achieve the desired results.

Solution 1 (https://lemmy.ml/post/25346014/16383487)

#! /bin/bash
files="/home/USER/projects/test.md"

mdlinks="$(grep -Po ']\((?!https).*\)' "$files")"
mdlinks2="$(grep -Po '#.*' <<<$mdlinks)"

while IFS= read -r line; do
	#Converts 1.2 to 1-2 (For a third level heading needs to add a supplementary [0-9]) 
	dashlink="$(echo "$line" | sed -r 's|(.+[0-9]+)\.([0-9]+.+\))|\1-\2|')"
	sed -i "s/$line/${dashlink}/" "$files"

	#Puts everything to lowercase after a hashtag
	lowercaselink="$(echo "$dashlink" | sed -r 's|#.+\)|\L&|')"
	sed -i "s/$dashlink/${lowercaselink}/" "$files"

	#Removes spaces (%20) from markdown links after a hashtag
	spacelink="$(echo "$lowercaselink" | sed 's|%20|-|g')"
	sed -i "s/$lowercaselink/${spacelink}/" "$files"

done <<<"$mdlinks2"

Solution 2 (https://lemmy.ml/post/25346014/16453351)

sed -E ':l;s/(\[[^]]*\]\()([^)#]*#[^)]*\))/\1\n\2/;Te;H;g;s/\n//;s/\n.*//;x;s/.*\n//;/^https?:/!{:h;s/^([^#]*#[^)]*)(%20|\.)([^)]*\))/\1-\3/;th;s/(#[^)]*\))/\L\1/;};tl;:e;H;z;x;s/\n//;'

Solution 3 (https://lemmy.ml/post/25346014/16453161)

perl -pe 's/\[[^]]+\]\((?!https?)[^#]*#\K[^)]+(?=\))/lc $&=~s:%20|\d\K\.(?=\d):-:gr/ge'

Relevant links

https://mike.bailey.net.au/notes/software/apps/obsidian/issues/markdown-heading-anchors/#background


Hi everyone !

I'm in need for some assistance for string manipulation with sed and regex. I tried a whole day to trial & error and look around the web to find a solution however it's way over my capabilities and maybe here are some sed/regex gurus who are willing to give me a helping hand !

With everything I gathered around the web, It seems it's rather a complicated regex and sed substitution, here we go !

What Am I trying to achieve?

I have a lot of markdown guides I want to host on a self-hosted forgejo based git markdown. However the classic markdown links are not the same as one github/forgejo...

Convert the following string:

[Some text](#Header%20Linking%20MARKDOWN.md)

Into

[Some text](#header-linking-markdown.md)

As you can see those are the following requirement:

  • Pattern: [Some text](#link%20to%20header.md)
  • Only edit what's between parentheses
  • Replace space (%20) with -
  • Everything as lowercase
  • Links are sometimes in nested parentheses
    • e.g. (look here [Some text](#link%20to%20header.md))
  • Do not change a line that begins with https (external links)

While everything is probably a bit complex as a whole the trickiest part is probably the nested parentheses :/

What I tried

The furthest I got was the following:

sed -Ei 's|\(([^\)]+)\)|\L&|g' test3.md #make everything between parentheses lowercase

sed -i '/https/ ! s/%20/-/g' test3.md #change every %20 occurrence to -

These sed/regx substitution are what I put together while roaming the web, but it has a lot a flaws and doesn't work with nested parentheses. Also this would change every %20 occurrence in the file.

The closest solution I found on stackoverflow looks similar but wasn't able to fit to my needs. Actually my lack of regex/sed understanding makes it impossible to adapt to my requirements.


I would appreciate any help even if a change of tool is needed, however I'm more into a learning processes, so a script or CLI alternative is very appreciated :) actually any help is appreciated :D !

Thanks in advance.

129
 
 

For a reason not worth mentioning here, I would like to write a somewhat more complex awk script in which I would have to explain in detail what I am doing. (If only so that I'll still know next week.) There doesn't seem to be a way to wrap a list of conditions in GNU awk, right?

This is what I tried:

command-that-prints-a-table | awk '
    NR>1 &&                # Skip line 1
    NF>2 &&                # Skip lines with only one column
    substr($1,1,1) != "("  # Skip lines that start with a "("
    { print $1 }
'

Alas, that does not work - awk skips the conditions entirely and only runs print $1. It seems that escaping the newlines does not work either, which makes sense as the end of the lines are comments.

This would work:

command-that-prints-a-table | awk '
# - Skip line 1
# - Skip lines with only one column
# - Skip lines that start with a "("
    NR>1 && NF>2 && substr($1,1,1) != "("  { print $1 }
'

But - my original code has a few more conditions - it is rather annoying to read and maintain. Is there an elegant way to fix this?

130
131
 
 

I recently switched from endeavouros to opensuse TW after joining the linux world 4 months ago (im a linux newbie) and i like the distro so far, but there's one catch

There's no sudo apt autoremove equivalent for opensuse and i find it really hard to choose which old .config, cache and other junk files i can delete to save space.

Can someone help me?

132
14
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/[email protected]
 
 

Well, as the post states I have a Ethernet port showing unknown after a reboot. Been running for a few years fine. Tried rebooting and restarting the network manager but I’m a loss here. Hardware is a nuc11 with an i7 and 2.5 gbe nic

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host noprefixroute 

       valid_lft forever preferred_lft foreverNZB Geek API: HMiN8DoCH6sEeqj7q7UE0Mtg4ewuXrZ6

Planet API: 842708488f4250ba2e98f460de23daa8

Update: I have found the NIC, it’s showing as “unclaimed”.

133
 
 

For a year now I'm dual booting OpenSuse Leap 15.6 with GNOME and Windows 11. I love that there are no trackers, that I have the chance to know what the system is doing, that I can support honest developers, the simple interface, how fast and reliable everything works. I would love to ditch windows for good. So, I hope you'll manage to point me in the right direction with some of my remainig issues

  • I encrypted GRUB and all partitions in OpenSuse. I have a TPM v2 chip. Now, every time I want to access one such partition I need to first enter the root password. I'd like to have access to all my partitions after I unlock GRUB and log in to my OS. Is this something that has to be done in fstab, system.d or somewhere else? If you could point me to some resources, it'd be great!
  • On Windows I'm using Total Commander to select multiple files, invert that selection, sync directories (meaning compare by content, size, copy from left to right, overwrite etc), pack and unpack archives, view, copy, move, rename files. I tried Krusader as a dual-panel manager, but I'm lacking the selection, sync features and it doesn't have the Gnome Look & Feel. If I install TotalCommander using Wine, I can't see the other partitions. Can you recommend a different dual-panel file manager or some way to make TotalCommander see all partitions?
  • Some movies skip frames or stutter. I assume I'm missing some proprietary codecs. How should I check what's missing? I have an AMD RX 6600 XT and haven't installed any special drivers or codecs until now.
  • When I shut down the computer I am logged out, the processes are killed, but then the computer hangs and I hear the fans working, but don't see anything on the screen. Any idea what logs I can tail or search to find what's triggering this or any ideas to fix this?
134
120
Hardening Mint (www.fosslinux.com)
submitted 2 weeks ago by [email protected] to c/[email protected]
 
 

Windows refugee here. I'm planning to move to Linux Mint but want to make sure I don't do something stupid, as I'm unfamiliar with the Linux operating system.

I found this link with 10 tips to secure Mint.

Is this a good list? Anything else I should do to secure a Mint install?

Thanks for helping a noob!

135
92
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/[email protected]
136
 
 

I still like the look and feel of GNOME a lot so I spent a little time putting it together that way. I want a simple desktop with small elements to maximize real estate for windows. I also use the small taskbar on my work computer for the same reason. But with my work computer, I do show window titles because I usually have at least 5 workbooks open at once so it's nice to see which is which when I need to switch between them.

I love KDE's application launcher. It feels very Windows XP with the way it sorts things. It just makes complete sense.

Century Gothic may not be the most readable font in the world, but I think it has an old school charm to it.

137
 
 

I have 2 directories which both have stuff in them:

  • /home/user/folderApple

  • /mnt/drive/folderBanana

I want to mount folderBanana onto folderApple like this:

sudo mount --bind "/mnt/drive/folderBanana" "/home/user/folderApple"

But I still want to be able to access the contents of folderApple while this is activated. From what I am reading, binding the original directory to a new location should make it available, like this:

mkdir "/home/user/folderApple-original"
sudo mount --bind  "/home/user/folderApple" "/home/user/folderApple-original"

But this just binds /mnt/drive/folderBanana to /home/user/folderApple-original as well. I tried reversing the order and result is the same.

How do I tell mount to look for the underlying directory?

I am happy to use symlinks or something else if it'll reliably get the job done, I am not wedded to this mechanism.

(The purpose of all this is that when an external drive is connected, I can have the storage conveniently available, but when it is not connected, the system will fallback to internal storage. But then I will want to move files between the fallback and external locations when both are available. So I need to see both locations at once.)

138
139
 
 

Hi.

I'm using Fedora KDE spin since last year, and have a need for the commands / a script to change power management and lock screen settings via the console (instead of manually going through the GUI).

I tried googling the commands, but feel like I didn't even get into the right direction.

If anyone could point me into the correct direction, that'd be greatly appreciated. A ready solution is nice, but I'd also like to know how to find such things by myself in the future.

Sorry if I use the wrong terminology, I used Windows until I switched last year.

(I posted this weeks ago in the /c/Fedora, but unfortunately didn't get any replies.)

140
141
142
143
 
 

Hello, I've been hearing a lot about this new DeepSeek LLM, and was wondering, would it be possible to get the 600+ billion parameter model running on my GPU? I've heard something about people have got it to run on their MacBooks. I have i7 4790K, 32GB DDR3, and 7900 XTX 24GB VRAM. I'm running Arch Linux, this computer is just for AI stuff really, not gaming as much. I did tried running the distilled 14B parameter model, but it didn't work for me, I was using GPT4All to run it. I'm thinking about getting one of the NVIDIA 5090s in the future. Thanks in advance!

144
145
 
 

Hello, I'm wondering if I should use the Linux-libre kernel or if I should stay with the stock Linux kernel. I do want to remain 100% FOSS and have Libreboot installed, but, does it really matter if I use the stock kernel or not? Can the blobs from the stock kernel be a vulnerbility? My only reason for wanting to stay with the stock kernel is because its better maintained and gets audited more. But I'm really just worried about the blobs, can they do anything?

146
35
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/[email protected]
 
 

Back again with another question thread looking for alternatives for my two most important apps that'll make me switch to Linux+Android:

Is there anything like PastePal on Linux with an Android app? The biggest thing about PastePal is that it lets me create a catalogue of text/images snippets that I can call up at any time on MacOS with CMD + Shift + V

The best part about it is that on iOS, I can use their custom keyboard and paste anything from my snippets library from the keyboard in places that don't usually allow you to paste text.

The app will sync everything I've copied on my Mac and make it available on my phone/iPad via either the app snippet library or the keyboard.

This is probably functionality that would be right up KDE Connect's alley to implement if it doesn't already exist.

147
 
 

Sooo there's free software (“Everyone should be able to write open source software!”) and there's open source software (people programming their own computers for their own communities). Ideally, Neima should be able to program her computer to help her kids do their homework or for their sports club. So there's open source software that's written for the developers community, and there's open source software that's written for the GNOME community, which is polished and truly a delightful experience for new users: if for example you installed Linux Mint with Cinnamon, you'd connect to the wifi and probably be immediately greeted with a notification telling you that your printer has been added and is ready to go.

I'm not saying that Linux users should learn programming, especially if they don't know about e.g. GNU Guix, Skribe/Skribilo/Haunt, or SICP (that's directly referenced by the Haunt info pages – I promise you, starting a blog as an English speaker with a Skribe implementation and reading SICP once you get comfortable enough could get you started in months); but that of course, learning any field on such a platform as Stack Overflow would provide an absolutely stupid experience, whereas the ideal learning medium is books.

It isn't enough for Google to insert far-right suggestions in YouTube shorts; they've deliberately sabotaged features in their search engine to get us to generate more ads, and Google Scholar results are, by the way, the bottom of the barrel too. Compare queries results to "sex work" or "borderline disorder transgender" with those of HAL and wonder why there's a public distrust in science. More broadly, Google hinders our relationship to information, and we're both trading it for a far-right agenda.

The same is just as true for LaTeX: it's a great, intuitive language, provided that you read some good introduction on the topic. As a matter of fact, Maïeul Rouquette's French-speaking book is available for free on HAL.

I'm more and more fed up as I write that and I'm pretty sure it shows. You may totally use open source software, meant for the non-technical community of a graphical library, desktop environment, Linux distribution, and so forth. But if you really wanted to "learn Linux", please install any distro you're comfortable with and read some good book on whatever topic you want to work on.

148
 
 

UPDATE: Resolved by deleting all files in /var and ~/.local that are related to bottles. It did not work until I deleted them from the repos directory too.

I tried to install bottles via flatpak, but I get the error:

Error: Error pulling from repo: While pulling app/com.usebottles.bottles/x86_64/stable from remote flathub: Opening content object fdb9f1f85b66889bd0dcced24c4fda571f2fcbddfe0af7176fa33a46953d2038: Opening content object fdb9f1f85b66889bd0dcced24c4fda571f2fcbddfe0af7176fa33a46953d2038: Couldn't find file object 'fdb9f1f85b66889bd0dcced24c4fda571f2fcbddfe0af7176fa33a46953d2038'
error: Failed to install com.usebottles.bottles: Error pulling from repo: While pulling app/com.usebottles.bottles/x86_64/stable from remote flathub: Opening content object fdb9f1f85b66889bd0dcced24c4fda571f2fcbddfe0af7176fa33a46953d2038: Opening content object fdb9f1f85b66889bd0dcced24c4fda571f2fcbddfe0af7176fa33a46953d2038: Couldn't find file object 'fdb9f1f85b66889bd0dcced24c4fda571f2fcbddfe0af7176fa33a46953d2038'

I have received such an error before, and usually running flatpak repair fixes it. But that is not working right now.

What else I tried?

flatpak uninstall --unused flatpak update flatpak update --appstream running all the commands as root

More about my system: I am using gentoo, but I did not think it would matter since the point of flatpak is this separation layer it has.

149
150
45
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/[email protected]
 
 

I'm on KDE Plasma using wayland, and I'm annoyed with KDE's emoji picker. Well, the interface is fine, I just want emojis to immediately be pasted into the text field that was in focus when I used the shortcut to launch the emoji picker. Basically I want the behavior to be as close to the Windows emoji picker as possible.

Does anyone know of an alternative that allows me to quickly type 2 different emojis in succession? Bonus points when it's easily available on arch.

view more: ‹ prev next ›