Your support is very much appreciated. Thanks, guys!
today I want to talk to you about some
of the dumbest things that I have done
on my Linux computers I have broken my
machines many times I've done some
really dumb things entered some commands
I shouldn't have entered in the terminal
you know I've really done some things
that are real head scratchers when you
think about it even when I think about
you know sometimes I do these things you
know and then I like why did I do that
and you guys if you've been a longtime
Linux users you know chances are are
some of the mistakes that I'm going to
talk about on camera today you guys have
made these mistakes and if you haven't
made these mistakes trust me if you use
Linux long enough you're probably going
to make most if not all of the mistakes
I talk about today so let's get the most
obvious mistake that I've made out of
the way the old pseudo rm-rf command so
we're forcibly and recursively removing
files and directories that command rm-rf
very very dangerous and I have on at
least two occasions wiped out my home
directory I have actually blown away my
users's home directory and all of my
user data you know all my documents and
videos music and everything now
thankfully in most cases I've got
backups for the really important stuff
but still you know you get that really
sick feeling in your stomach when you
blow away an entire home directory again
I've done that on two occasions I you
know the one that everybody talks about
is Pudu rm-rf on rout but you typically
can't remove the entire file system with
the RM command on at least most modern
Linux distributions they have
Protections in place where if you try to
do a rm-rf on rout they won't let you do
it without you jumping through some
extra Hoops you know you have to add
another command an extra flag you know
you have to give them a little bit more
information as a confirmation hey I
really want to run this command I really
want you to delete the entire root file
system so typically you're safe from
that but you're not safe from deleting
your home directory typically there are
no protections in place for that and
again I I've done that on a couple of
occasions and I'm not the only one
because I see people all the time on
Linux forms not all the time but it's a
very common occurrence when people talk
about their Linux horror stories
deleting your home directory is one of
them so be very careful with rm-rf and
really be careful with any recursive
terminal command because I've also
ruined some Linux installations
completely hosed a couple of Linux
installations by doing a recursive CH
mod chod is change mode change
permissions of files and you never want
to chod recursively like on the root
directory so you basically change file
permissions for every file to the same
file permissions you know in the entire
file system and when you do that you
have completely broken your system
because certain files in a Linux file
system have to be a certain permission
and when you recursively CH mod
everything to I don't know permission
755 for example well your system is
completely broken because there's a lot
of things especially in the root file
system you know and like slash Etsy SL
Boot and slpr SL you know there's a lot
of things in those directories that need
certain permissions and you can't go
back and put the the genie back in the
bottle once You' run that Command right
you can't unfire that bullet once you've
done that recursive CH mod you've
completely messed up your file system
and you you're never going to be able to
fix it you might as well just start
reinstalling right then so just be very
careful with those recursive terminal
commands don't ever run a recursive
terminal command on Route just don't
ever do it and also be very careful when
you run a recursive command on your home
directory especially if it involves the
remove command along the same lines I've
also run into this situation with these
recursive commands where I didn't enter
them in a terminal but I was using them
as part of a script I was doing these
fancy Scripts you know where I change
things on my file system via A bash
script for example and sometimes I had
unintended consequences using RM in a in
a bash script for example sometimes with
the- RF flag but sometimes not sometimes
I using RM as part of a a for Loop or
part of xr's you know exec or whatever
it happened to be but for whatever
reason you know I I didn't think through
this bash script properly and it was
basically removing files and directories
it should I've done that before where I
wrote a script and I ran it and like it
deleted you know half my home directory
right and it was supposed to really just
delete files in One Directory but you
know or maybe the way I wrote the script
you know it was supposed to be executed
from a particular directory and if as
long as it was executed from that
directory it would be all right but if
you moved the the script and ran it from
that directory then something else would
happen so be very careful when you're
scripting especially with dangerous
commands like the RM command or the chod
command again another really dumb
mistake I've done and it's one of these
mistakes we all do if we've used Linux
for long enough especially if you drro
hop a lot and so you're constantly
reinstalling Linux distributions
sometimes you format the wrong Drive
especially those of us that have done
the DD command so typically when you do
command line installations what you do
to format a drive to wipe a drive you'll
run the DD command on it the problem
with running the DD command is it's very
easy to do DD and then the path to the
wrong drive for example I wanted to
format /d SDA but for whatever reason I
typed /d sdb oops right so U be very
careful with the DD command again that's
one of the ones that I I think if you
use Linux long enough especially if
you're constantly hopping reinstalling
operating systems and you have multiple
drives in a machine eventually you're
going to format the wrong drive just
just prepare for it and again for really
important data always have a backup
another mistake I've done many times is
I've accidentally remove the wrong
packages so I do all of my package
management stuff at the terminal I I've
never used graphical package manager so
I'll just use the APT package manager if
I'm running deian or auntu or Pac-Man if
I'm running Arch or whatever
distribution they all have package
managers command line package managers
you can run in the terminal and
sometimes you'll run into a situation
where you run a package manager command
and for whatever reason it goes and
removes programs that you didn't expect
it to remove for example on Arch based
systems I have run the command to remove
orphan packages before and one of the
orphaned packages that it removed was
the Linux kernel that's that's bad
because you go to reboot and without the
kernel right your computer is not going
to boot but have no fear right that's
actually a easy fix all you have to do
is get a USB stick with a Linux
distribution on it you know and use that
stick to choot back into your Arch Linux
installation and then install or
reinstall the Linux kernel and then
reboot voila you know you should be back
up and running on a boonu I've run into
the situation where sometimes you know
the auntu desktop package is a big meta
package of The Gnome desktop and you
know a bunch of other utilities before
that the unity desktop was like this as
well where sometimes you would go and
remove a certain component of of the
unity desktop or the gome desktop and
it'll just remove the entire desktop
environment so without the desktop
environment then you're stuck in a TTY
when you reboot because you don't have a
desktop environment if that was the only
one installed on the system but again
that's an easy fix because just go to
the TTY you know the terminal and just
reinstall gnome or Unity whatever plasma
whatever desktop accidentally got
removed just reinstall it then you know
reboot you should be good again another
mistake I've made a couple of times just
a couple of times and and you usually I
I don't do this now because I know not
to do this but when I was kind of new to
Arch Linux sometimes I would run a
partial upgrade what a partial upgrade
is is you upgrade some packages on your
system but not all the rest and the
problem with that with a rolling release
like Arch Linux is every package in its
repos are built against the same set of
libraries so if you do a partial upgrade
and the way a partial upgrade works is
if you ran the command Pacman - capital
S lowercase y to resync the repos and
then give it a name of package you know
it's for example htop well it's going to
update htop to the latest package but it
doesn't update the rest of the system to
the latest package and latest libraries
so you'll have that one program that you
updated that's is on the latest version
but the rest of your system is not on
the latest version and sometimes doing
that can cause some really unintended
consequences where packages are broken
and thing you know things just don't act
right so never do a partial upgrade and
speaking of packages I don't do this
much these days because package
Management on Linux is in a much better
place than it was you know 10 15 years
ago but back in the day I really I built
too many things from Source because
there were things that I wanted to
install programs I wanted to install
that weren't in the repos for whatever
distribution I happened to be running at
the time so I would just go grab the
source off of GitHub or gitlab whatever
you know wherever I could find the
source and if they had instructions on
building that package from Source I'd
just build it from source which means
that program is not managed by the
package manager on my computer anymore
because the package manager didn't
install it I installed it right I
manually compiled it and installed it
and you know if you do that a lot if you
have a lot of programs on your system
that you've compiled from source that
aren't being managed by your package
manager that too can cause some some
headache in your life because now you're
responsible for managing those packages
making sure they're up to date when they
break you've got to go fix them where if
they were just in your distributions
repositories it wouldn't be a problem
now of course I said these packages
aren't in the distributions repository
so why am I building them from Source
well back in the day I didn't have any
other choice but now typically if
they're not in your distributions
repositories those packages chances are
are available as a snap as a flat pack
as a app image or in some of the uh
programming language specific formats or
in the Nicks package manager and the
Geeks package man like we have so many
more options today than we had 15 years
ago another similar problem I ran into
back in the day but you know I probably
would never do this now but I did it a
couple of times when I was kind of new
to Linux was adding new repositories to
my Linux distribution and by adding new
repositories I'm talking about
repositories that really didn't go with
that particular distribution for example
I sometimes with Debian based
distributions would just switch all the
mirrors from stable which most Debian
based distributions are on the stable
Branch I just switch all the mirrors to
unstable and and do a massive upgrade of
a thousand plus packages and then reboot
and hope the system was working now but
now on the latest packages because I'm
on unstable that's typically dangerous
the the chances of that working are very
very slim ask me how I know and a couple
of times I have done the really dumb
thing of using a repository from one
distribution adding it to another the
most obvious example of this is adding a
Deb repository to auntu which I mean
Debian and auntu aren't they both Debian
based distributions right auntu is based
on Debian well they are but I mean auntu
is really much more of a a fork from
Debian like it really does its own thing
and those packages that are in the auntu
repositories those package versions may
not match what Debian is on so that is a
really dangerous thing like if you for
some reason there's something in the
Debian repo that's not in the auntu repo
so you add one of the Debian repos maybe
the Debian unstable repo just to pull
down that one package that you want from
that repo on an abtu machine oh don't do
that like really don't do that it may
work for you but there's a very high
likelihood that you're going to break
things and I've read some just crazy
horror stories of people doing even more
ridiculous things with adding repos I
remember reading one guy I don't know if
I I'm assuming he was working with
servers because of the two distributions
he was doing this on he mentioned that
he added a Debian repo to a Centos
installation and then you know when he
went to install thing like like he was I
I don't know if he was able to get that
to work but he was asking people could
he do it like he he wanted to try it and
everybody was like dude that's the
craziest thing I've ever heard how are
you going to add the deian repo to cnos
which is rpm based distribution deian of
course as de package formats but even if
it could work even if they were both
debased distributions or they were both
RPM distributions they're not still on
the same package versions right if
they're different distributions like
never ever add a repo from another
distribution to your distribution
because again that's just you are going
you're almost 100% guaranteed to break
your installation just don't do it so
that was I don't know seven or eight
really dumb things I've done on my Linux
installations and honestly those are
kind kind of common mistakes that a lot
of Linux users have made if you go to
Linux chat rooms and subreddits and
forarms and whatever it happens to be
any kind of support channel for a for a
Linux distribution you will find many
examples of people removing directories
they shouldn't remove or you know uh
removing packages they shouldn't remove
you doing these weird things entering a
terminal command to do something
recursively that they shouldn't have
done just make sure you know it's not
one of those things that's the end of
the world most of these have easy fixes
the only ones that are very serious are
the ones that are actually deleting your
data you know deleting your entire file
system or your entire home directory
those are very dangerous if you don't
have a backup now if you have your data
backed up even those no big deal right
you just go grab your backups you'll be
back up and running in you a matter of a
few minutes in the end all of these
mistakes that I've made they're learning
experiences now you know when I make
these mistake like if I made any of
these mistakes now I know exactly how to
fix them because I I made them in the
past some of them I made multiple times
in the past so it's again you know don't
view mistakes as some unfortunate event
in many cases you're a better Linux user
for having made these mistakes peace
guys