35
votes

What is the most damage (of whatever kind) that you have ever caused with a single mistaken/mistyped/misguided command line? I deleted a production system database by mistake a while back, for example, but I was lucky (i.e. backed-up) and there was no permanent data loss, lost money, property damage etc.

Most importantly (for votes), what do you do to make sure it will not ever happen again?

7
  • 9
    Since this is a poll, it should be CW
    – Eddie
    May 6, 2009 at 2:00
  • Then why aren't polls CW by default?
    – Luke
    May 6, 2009 at 4:19
  • 4
    How should they know it's a poll progmatically?
    – Mikeage
    May 6, 2009 at 8:14
  • 1
    If the mechanism is the same as SO's, even if you can edit a question, you can't change it to CW. Only the OP or a moderator can do that.
    – chaos
    May 6, 2009 at 14:09
  • 9
    Good idea - post your most destructive mistake publicly on the internet for all future employers to see! :) May 13, 2009 at 19:29

81 Answers 81

2
votes

In a DOS prompt I typed the following command at my computer

C:\deltree /y *.*

Now I just select with the mouse what I want to delete and delete them.

2
votes

Working for hours and hours editing configuration file to configure an application, only to confuse the configuration file for a temporary file, and delete it. Damn auto-completion (and my own inattentiveness!)

2
votes

Delete the payroll database... :(

rm PAYROLL

Had intended to delete a text file of a similar name, PAYROLL.txt. Spent the rest of the afternoon restoring the previous backup and then running a series of audits to rebuild the payroll based on other supporting tables.

All in all, it was a pretty freaky experience (both the loss and the recovery)... :)

Piko

2
votes

When removing a config snippet I had just added into a core mpls router I was doing it by typing

no

then pasting in the line to remove. Unfortunately I had the wrong line in my paste buffer. I thought I had

vll id X

I was wrong and I still had the previous command in the buffer. The last thing I saw from that router before it stopped responding was

router(config)#no router mpls

Thankfully we had out of band management so I was able to get back in and restore all the mpls config from backup.

As for making sure it never happens again. First I argued with upper management that we should have automatic service deployment like we did for the switch network and I made sure "router mpls" never ever went near my paste buffer again. I always typed that line in by hand.

2
votes

% dd if=linux_boot_floppy.img of=/dev/hda

instead of:

% dd if=linux_boot_floppy.img of=/dev/fda

/dev/hda == hard drive

/dev/fda == floppy drive

First thought was, "Oh wow, that was fast". Second thought was, "Oh ****".

2
  • Awesome - I've done this too, except in my case it was: Write floppy image to floppy, Reboot, "Oh... invalid disk... odd", Remove floppy, see floppy image loader, realize horrible mistake. Only lost the first partition (Windows).
    – MikeyB
    Jun 25, 2009 at 16:52
  • I’ve done that too. I thought I was dd’ing an image to /dev/sda5, but I left the 5 off the end. Thankfully given that the OS was running and I had an SFTP connection open to a remote server at the time, I was able to back up just about everything of importance. Oct 12, 2010 at 13:15
2
votes

I ran cleanlinks in my $HOME directory. Apparently, some links should stay dirty and some empty directories matter (say the ones in your mailbox folders). Feh.

1
  • Could you supply more details? Sep 28, 2010 at 22:32
2
votes
Thinking: "Before i do this upgrade, I'd better be safe than sorry, and take a backup."
Writing: tar xzvf backup.tgz /path/to/production_site &
... time passes
... checking size of backup.tgz
Thinking: Why is this file not growing?
... thinking some more
... time freezes, realising that a week of development on the site is gone, overwritten by an old backup.
2
votes

In teaching a new Junior Admin how to do something, he made a typo and we didn't catch it before he hit enter. So instead of:

kill -9 <somepid>

We did:

kill -%9 <somepid>

On a Solaris 7 machine, this apparently translates to "halt". (I could be mis-remembering the exact typo, but a % was involved).

The machine was a three hour drive away at a client's site. We had to call them and beg them to switch the machine back on.

2
votes

I once copy/pasted some "bash magic" script which I didn't understand from a slashdot comment, which had no warning and no comment other than that one liner. That's just stupid, I know.

It turned out that evil lines spawned bash processes in a loop which rendered the server completely unresponsive. Luckily it was based on XEN and I was able to reboot it using xm reboot (calling data center to do manual reboot is always messy). On the other hand, I didn't have access to dom0 instantly.

Lesson learned - don't copy/paste stuff you don't know :)

1
  • Probably what is know as a fork bomb. Apr 9, 2010 at 22:10
2
votes

I used to be a linux lab admin, and one of the students was trying to get her Joomla install to work. She needed to add execute permissions to one of the files. Not knowing much, she was going to do:

chmod -R 777 /path/to/joomla/

Except what she did was:

chmod -R 777 /path/to/joomla /

Turns out that her complete filesystem(/etc/passwd, /etc/shadow...) was 777.

When you don't specify all the modes, it presumes you want to remove the permissions that would go with them. So everything was now mode 0777(i.e. no sticky, set user/groupID). There's a lot of important stuff that's set-uid, like su.

1
  • That is too funny..
    – Brian G
    Jul 9, 2009 at 19:56
2
votes

Most annoying mistake I remember doing was a some years back when hardware where expensive and we often used software routers/firewalls rather than hardware ones. One night we got hit by some pretty bad DDoS. Trying to debug this/figure out what I could do, I logged onto the main router and started doing tcpdumps, however the system were so insanely unresponsive that I figured Id better just drop the firewall rules so that I can hopefully get some sorely needed cputime. So I typed;

ipchains -F

Problem is, default policy of all chains were drop. Had to call up my boss in the middle of the night, take a cab over and fetch a keycard then get onsite and manually reboot the router.

2
votes

Back in dark ages of DOS there was a utility called, as far as I remember, killtree, that deleted a directory tree without any confirmation.

I then had a keyboard that had the \ under the Return.

Under Norton Commander I wanted to delete a directory tree in c:\ I had the selection over, so I type:

killtree Right Ctrl + Return

Ctrl Return combination was used to insert file/dir name under the selection into the command line.

The problem is, instead of Right Ctrl, my finger went to the \...

3
  • That utility would be deltree
    – Demi
    Oct 22, 2013 at 23:27
  • No no, that was a third party utility. deltree always asked for confirmation, as far as I remember. killtree was more of a dangerous power-user alternative. With great power comes great responsibility, I suppose. ;)
    – macbirdie
    Oct 23, 2013 at 12:35
  • 1
    "With great power comes a really large hole in your foot."
    – MadHatter
    Oct 23, 2013 at 12:36
1
vote

and now for a Win XP commandline complete screw up :

C:\Somedir> cacls.exe * /r Someuser

did something much worse than expected

1
vote

I know someone who wrote a custom tool to delete a tree recursively and tested on a network drive that did not return ".." as one of the "find next file" entries.

The first time it ran on a drive that did return ".." it backed up to the root and wiped clean the volume.

2
  • 2
    Why the heck would anybody write a custom tool to do that? Reinvent the wheel much?
    – MikeyB
    Jun 25, 2009 at 16:53
  • It was back in the DOS days and RD /S wasn't available at that time.
    – piCookie
    Jul 8, 2009 at 18:05
1
vote

This was a LONG time ago and I was a real newbie to PCs being primarily a Mac tech. But a big Pharma company in NJ was migrating from WIN 3.1 to Win 95.

Our instructions were to boot from our special network boot floppy, CD to the C: drive and delete everything on the drive with your standard DOS command to do so.

I had done a dozen of these with no problems till one where I forgot to CD to the C: drive. Seems the floppy left your current directory as the network drive that held the install files that you were supposed to just copy to C and then reboot to run.

I think you can see this one coming. I neglected to change directory before issuing "DEL STAR DOT STAR" and the brilliant sysadmin who had set it up made that share R/W to EVERYONE and bang away goes all of the files that were needed by about 30 techs swarming over the building trying to get several hundred PCs upgraded over the weekend.

And to make matters worse, they had no backup.

So everyone went home with no idea of who did this grumbling about lost overtime. And a few SysAdmins grumbling about having to rebuild the install share from scratch.

Needless to say I was "busy" next weekend when they tried again.

1
vote

shutdown -h now on production database system I was connected via remote ssh tunnel. I suspected something was wrong when instead of shutting down my own box I got the message "connection closed by remote host" ;)

1
vote

as root:

find / -type d -exec chmod 755 {} \;
find / -type f -exec chmod 644 {} \;

I ended up rebuilding the box.

... true story.

1
vote

I wanted to remove all "~" backup files (passwd~, group~, resolv.conf~) and on a Swedish keyboard you need to press the ~ button and a space to write a "~" and what I did was:

$ rm  * ~

In /etc

1
vote

Easy easy... hitting ENTER when my screen has been scrolled up in order to return it to the command line. I've ran the wrong command a few times doing this. I've gotten in the habit of hitting CTRL-C instead.

1
vote

We had a FTP script that would update directories which housed our Client's reports. The script looked like this...

ftp www.ourcompany.com
cd <ClientsDirectory>/
put *.html ( including index.html ) 

So just what happens when <ClientsDirectory> does not exist?

You get the client's index page as your companys home page... Opps

1
vote

Ubuntu 10.10, I had only 3gb left on my partition so clearing up files.

I thought, ah well, might as well remove old kernels (GRUB screen was becoming too big too).

sudo apt-get remove --purge 2.6.28*

The asterisk was a little bit... greedy (though I still don't know how it managed to match 2.6.29 and .30).

Epic freakout, didn't dare to ctrl+c (what's worse then deinstalled kernels? that's right, semi-deinstalled kernels). Let it run and reinstalled latest kernel. I even opened an edited document in gedit so it would block any restart (I know, I know...).

0
votes

cd /

rm -rf ./

1
  • Were you trying to free up disk space, or what? ;-)
    – Josh
    Feb 26, 2010 at 15:07
0
votes
rm -vfr /*

Which I now do: rm -vfr ./*

3
  • 4
    Why not just "rm -vfr *"?
    – Ivan
    May 6, 2009 at 0:02
  • Simply put, I've never thought of that. :( May 6, 2009 at 0:21
  • Actually ./* works better than a simple * when there are files with names like -f in the current directory. Sep 28, 2010 at 22:36
0
votes

using joeware ad tools I had a script which was supposed to change a user account from 512 (active) to 514 (disabled user) in the useraccountcontrol attribute.

the command was:

 admod -b "userdn" useraccountcontrol::514

but I was also attempting to redirect the output by putting a 2>nul on the end, but I missed the space and the 514 became 5142 which caused AD to change user accounts to Computer accounts, this was run on a the production domain against all accounts.

0
votes

Easy one in - and I've done it more than once:

Del from Some_Table

without any qualification. Always do a 'select from' first now to make sure I've got the correct data.

0
votes
DROP TABLE [dbo].[WRONGTABLEHERE]

Then the immediate feeling of terror as soon as I executed it.

0
votes

I was in / instead of another directory and performed the command below.

rm -Rf *

By the time I canceled the command, nearly all the /usr/ directory had been removed.

0
votes

On a Windows NT 4 domain controller back in the day:

C:\WINNT\System32>DEL *.*

I had been working in a subfolder (WINS I think) and was expecting to delete that folder, but wiped out most of System32 instead.

How do I make sure that never happens again? I do things a little slower these days.. double check that command line before pressing enter.

0
votes

Back in the DOS days I was trying different commands to see what they do. I knew enough to not mess with fdisk or format but I saw this neat looking command called recover.....wiped out the entire machine....Taught me to never run a command unless you have some idea what it does.

1
  • The "recover" command was sometimes useful on a floppy disk. But it couldn't cope with a hard disk. This was partly because its working space was a whole disk.
    – staticsan
    Jun 11, 2009 at 3:08
0
votes

After 12 hours of weekend work, wanting to check IP address of server hostXYZ and while being logged in to a HP-UX MC/ServiceGuard cluster node, I typed in:

hostname hostXYZ

I was immediately covered in cold sweat. :) Luckily I managed to revert back to old hostname before ServiceGuard even realized what happened. :)

1
  • 1
    What would it have done? Jun 25, 2009 at 18:05

Not the answer you're looking for? Browse other questions tagged .