source ~/.bash_history
Linux
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
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
Types
rm -r -f Presses strg+v (instead of strg + shift + v)
Hits enter
Maschine proceeds to delete the home folder as the garbage that comes when pressing normal strg+v gets interpreted so...
Don't get me started.
There are good reasons why I have personal "production system" to do my work with.
I was new to Linux, I made the not so calculated decision to use manjaro as my daily, deleted xorg to in an attempt to reinstall xorg to then hopefully fix the stuttering. Everything went wrong, no display obviously, /boot/ files where corrupt. I now use arch and am wiser
I ran firejail config or something, which replaces a lot of home directory app files. Not sure if binaries or desktop entries.
But things broke, randomly, screenshots not working, not even inside firefox etc. I reinstalled the system and imported the home folder... and it was there again!
Relied on an AUR package for building and signing my unified kernel image... one day it was outdated and geberating the image failed, I noticed that by the fact that the system refused to boot my OS. Fixing it was done in a few minutes but boy, that was a shock :D
Guess who also checks the exact output of the kernel rebuild now before rebooting!
My own classic was fiddling with the nvidia PRIME config to try and get rid of some very mildly irritating screen tearing. No graphics output at all. Now this is fixable of course, but it's a pig.
And I'd decided to do this 2 hours before an incredibly important progress review meeting for my PhD.
Got it back with about 10 mins to spare and decided just to leave the driver config alone after that.
Bonus round
Also a friend managed to bork his ubuntu 16 laptop by trying to switch from unity to gnome and ending up with sort of neither. That was reinstall territory right there.
CTRL-C-ing apt because it looked stuck for more than 10 minutes. I don't recommend doing it.
Built a new desktop, backed up everything on my old laptop, next step was to format an Arch installer USB. Instead of formatting the USB, I formatted my laptop's /boot partition. No big loss since I had the backup and was done with that old toaster, but oops.
Not the installation strictly speaking, but my most "funny" fuckup was setting up xfree86. There was a configuration for crt monitor scan frequency that you had to setup. I messed up something and the monitor started to squeel like crazy and quickly hit hard reset in panic.
The monitor didn't die, but it had a slight high pitch noise to it after.
Deleted my entire efi partition while trying to install some grub themes.
And then my backup didn't work when I tried to restore it.
I have pretty colours now though, so it was all worth it :)
For me, it was a simple enabling of AUR im manjaro, twice Now I use arch, lol.
Tinkering is all fun and games, until it’s 4 am, your vision is blurry, and thinking straight becomes a non-option, or perhaps you just get overly confident, type something and press enter before considering the consequences of the command you’re about to execute… And then all you have is a kernel panic and one thought bouncing in your head: “damn, what did I expect to happen?”.
Nah, that's when the fun really starts! ;)
The package refused to either work or install complaining that the version of glibc was incorrect… So, I installed glibc from Debian’s repos.
:D That one is a classic. Most distributions don't include packagers from other distros because 99% of the time it's a bad idea. But with Arch you can do whatever you want, of course
My two things:
- I've heard about some new coreutils (rm, cp, cat... this time the name really fits the contents :D) and I decided to test it out. Of course it was conflicting with my current coreutils package and I couldn't just replace it because deleting the old package would break requirements. So without thinking I forced the package manager to delete it "I'll install a new one in just a second". Turns out it's hard to install a package without cp, etc :D
- I don't remember what I was doing but I overwrote the first bytes of hdd. Meaning my partition table disappeared. Nothing could be mounted, no partitions found. Seemingly a brick.
Turns out, if you run a rescue iso, ask it to try and recognize partitions and recreate the table without formatting, Linux will come back to life as if nothing happened
Nah, that's when the fun really starts! ;)
Well, on the upside, it definitely works better than coffee or energy drinks :D
Also, nice save with the last one!
Found out the hard way that if you edit /etc/sudoers with anything other than visudo you best be absolutely sure the syntax is correct, otherwise sudo will refuse to read it and you'll be locked out.
Also learned to add -rf to the rm command at the end, after I re-read it to make sure it does what it should do. Something like rm /path -rf instead of rm -fr /path. That protects you from your fat fingers hitting the enter key half way through.
Been there with sudo. Fortunately, su
still works, as well as going to another tty and logging in as root. Well, as long as the root login is enabled; otherwise that old hack with init=/bin/bash
may work, unless you've prohibited editing kernel cmdline in the boitloader or decided on efistub
IIRC the root account was disabled (with no password), so I resorted to my trusty SystemRescueCD pen to fix things. Never leave home without it.
fstab bind mount for /home that I misspelled, so I couldn't login as myself.
fstab external hdd mount that didn't have ignore flag so PC would pop if I booted while unplugged
Accidentally booting windows after a year and it overwrite my EFI boot entry.
The best I've see however was an acquaintance who accidentally set perms to own user on /usr/bin
So everything went from root:root to user:user which removed all the SUID/SGID bits as well so a bunch of bins broke lol.
Believe it or not, it was actually fairly easy to fix with chmod and chown
I have an embedded device that runs as root and has busy box. I accidentally ran chmod -x on one of the busy box sym links (strings I think) and it made all of the core utils un-executable. Unfortunately chmod is a core util. Every bash command was throwing wild errors and outputing gobbledygook. You really start to sweat when ls and cat stop working.
I had full disk image of the device and started deducing the issue. Luckily I could still execute non core utils and ssh/scp was working so I wrote a little program to restore permissions, uploaded/ran the binary, and learned nothing from the experience.
Had the issue with the ignore flag missing literally a week ago. I mounted the HDD to troubleshoot it, ended up kicking the bucket, couldn't read any partitions from it anymore, but I had the Partuuid in fstab. Had to plug the main drive of the system into another one to fix fstab....
One that I can remember many years ago, classic trying to do something on a flash drive and dd
my main hdd instead.
Funny thing, since this was a 5400rpm and noticed relatively quick (say 1-2 minutes), I could ctrl-c the dd, make a backup of most of my personal files (being very careful not to reboot) and after that I could safely reformat and reinstall.
To this day it amazes me how linux managed to not crash with a half broken root file system (I mean, sure, things were crashing right and left, but given the situation, having enough to back up most things was like magic)
First, the classical typo in a bash script:
set FOLDER=/some/folder
rm -rf ${FODLER}/
which is why I like to add a set -u at the begining of a script.
The second one is not with a Linux box but a mainframe running AIX:
If on Linux killall java kills all java processes, on AIX it just ignore the arguments and kill all processes that the user can kill. Adios the CICS region 😬 (on the test env. thankfully)
If on Linux killall java kills all java processes, on AIX it just ignore the arguments and kill all processes that the user can kill.
jfc, is ignoring arguments the intended behavior?
On a real UNIX (not only AiX) killall is part of the shutdown process - it gets called by init at that stage when you want to kill everything left before reboot/shutdown.
Linux is pretty unique in using that for something else.
I didn't know that, good to know.
They could have send a SIGTERM by default instead of a SIGKILL. I would not have corrupt everything 😅
killall typically sends SIGTERM by default. It accepts a single argument, the signal to send - so shutdown would call it once with SIGTERM, then with SIGKILL. killall is not meant to to be called interactively - which worked fine, until people who had their first contact with UNIX like systems on Linux started getting access to traditional UNIX systems.
It used to be common to discourage new Linux users from using killall interactively for exactly that reason. Just checked, there's even a warning about that in the killall manpage on Linux.
First time trying Linux I went with an arch install because I Googled "best version of Linux" and went with arch. Followed a guide to the point of drive formatting and I decided to go with a setup with drive encryption. I didn't understand what I was doing, ended up locking myself out of my hard drives and couldn't get windows to reinstall on them. I used a MacBook for a week until I installed Ubuntu and managed to wipe and reset my drives and reinstalled. Needless to say I am going to read up a little more before I try that again.
Archinstall python script is your friend 😄😉 I tried install arch manually, but as I learned that not even sudo is included in the Linux essential packages, I stopped the process and went back to aromatic script install, lol, got no time for that S*** 😂
Been there, and even without encryption: took me to reinstall a few times before I realized I can chroot again and repair 😅
I once deleted the network system in alpine. I'd been having some trouble with with the default one (I think wpa_supplicant) so I decided to try the other one (I think iwctl). But I thought that there might be problems with havung both of them so before I installed iwctl I deleted wpa_supplicant (thinking that it was more of a config utility than the whole network system), only to find that I couldn't connect to the internet to install iwctl.
Not quite catastrophic but:
I'm in the process of switching my main server over from windows to Linux
I went with Deb 12 and it all works smoothly but I don't have enough room to back up data to change the drive formats so they're still NTFS. I was looking at my main media HDD and thought "oh, I'll at least delete those windows partitions and leave the main partition intact."
I found out the hard way that NTFS partitions can't just reclaim space like that. It shuffles all the data when you change the partition. It's currently 23 hours into the job and it's 33% done.
I did this to reclaim 30 MB of space on a 14 TB drive.
You mean you've removed the service partitions used by windows and grown the main one into the freed space? Than yes, it's not the way. 'Cause creating a new partition instead of growing the existing one shouldn't have touched the latter at all :/
Tried to convert Ubuntu to Debian by replacing the repos in sources.list and apt dist-upgrading. 💣 Teenagers...
Many many years ago I wanted to clean up my freshly installed Slackware system by removing old files.
find / -mtime +30 -exec rm -f {};
Bad idea.
Debian sid a few years ago: Uninstalled Python2, system became unusable and couldn't neither reinstall from APT neither recompile it
Did it on Ubuntu and nothing worked anymore. Somehow managed to recover.
I was much more inexperienced in Linux at the time, I could probably fix it now if the same thing happened again.
Before installing Arch on a USB flash drive, I disabled ext4 journaling in order to reduce disk reads and writes, being fully aware of the implications (file corruption after unexpected power loss). I was confident that I would never have to pull the plug or the drive without issuing a normal shutdown first. Unfortunately, there was one possibility I hadn't considered: sometimes, there's that one service preventing your PC from turning off, and at that stage there's no way to kill it (besides waiting for systemd to time out, but I was impatient).
So I pulled the plug. The system booted fine, but was missing some binaries. Unfortunately, I couldn't use pacman to restore them because some of the files it relied on were also destroyed.
This was not the last time I went through this. Luckily I've learned my lesson by now
When Ubuntu 16.04 had just been released, I tried upgrading my 14.04, the whole system broke and I had to install another os (Manjaro won).
That day I learned Ubuntu too can be a bit stupid.
Not me, but one I saw... dude used chmod to lock down permissions across the board... including root... including the chmod command.
"What do I do?"
🤔
"Re-install?"
You could boot on an USB, mount the filesystem and change the permissions. But if the dude changed a whole lot of permissions, reinstalling might be the smart thing to do...
Changed it all to 000. ಠ_ಠ
There's got to be other tools though that could change the file permissions on chmod, right? Though I suppose you'd need permission to use them and/or download them.
You can dump the permissions from the working system and restore them. Quite useful when working with archives that don't support those attributes or when you run random stuff from the web 😁
Many distros offer a automated file/directory ownership restore feature on their liveOS