this post was submitted on 14 Nov 2026
42 points (87.5% liked)
Linux
68768 readers
796 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
- 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
founded 7 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This is apparently a joke! But I have done this in real life. It's an honest mistake you can make if you're experienced, fast, complacent and careless. Always be prepared for it. Here are some tips:
Don't use
sudofor anything other than system operations. Not even for editing configuration files.Never put any development/sysadmin projects under ownership of root. Always develop the project under your personal unprivileged user account. Use
sudoonly for the final deployment of project to system directories.Use
sudoeditto edit any system configuration files.Avoid
./*at all times in favor of just*. While this is counterintuitive, this is actually safer. You will have less habitual urge to type the/alone by accident.Avoid the
-fflag in all instances for any command until some operation fails. That will leave you with enough time to reflect on your mistakes when you make one.Always keep a data recovery plan. Backups are highly recommended. If you use Btrfs partitions, you can make periodic read-only snapshots of your critical data. You can automate this process with a tool like Snapper.
Btrfs snapshots store de-duplicated data. So each snapshot stores only the changes from the previous one. It doesn't use a lot of space, even when backing up large media files. You'll still get the chance to recover your data at the time of the last snapshot.
Most operating system files aren't critical data and don't need to be backed up. Backup the system configuration files in
/etcand the package installation list if your package manager facilitates it.This is optional, but useful in case your Linux installation gets nuked somehow, including this nonsense.
You can always reinstall the distro and start over again. But often times, you can trivially recover the installation by booting from a live USB/CD and doing some manual repair. Learn to
chrootinto your nuked root partition and operate from inside it.Most live disks give you an option to repair an installation, in case you deleted the root partition by accident. You can also repopulate the deleted files using commands like
debootstrapandpacstrap.