Linux Classes
Linux Classes
Share This With a Friend
LINUX CLASSES - FILES

What Are The Nine Deadly Keystrokes?

Don't Try This at Home

At the beginning of this section, I promised to reveal the Nine Deadly Keystrokes that could wipe out your entire file system. Given what you know now about the rm command and the structure of the Linux file system, perhaps you can see that the command rm -rf /

would be something to avoid at all costs if you were logged in as root. But don't let this scare youit's just a reminder to be careful when deleting files.

You can avoid nasty surprises like this by running the pwd and ls commands before you delete anything. (Use ls on the same file or directory that you're going to delete.) Then you'll always be sure what directory you're in and what files are about to be deleted.

And in general, it's a good idea to log in as root only when you're performing system administration tasks such as adding new users or installing software. Create another account and use it for all your normal everyday Linux tasks.

Previous Lesson: Linux Files - Wildcards
Next Lesson: Linux File Permissions

[ RETURN TO INDEX ]



Comments - most recent first
(Please feel free to answer questions posted by others!)

Sarah (21 Jan 2017, 09:18)
Is there any reason why:

sudo apt-get remove --purge alsa-base pulseaudio

sudo apt-get install alsa-base pulseaudio

sudo alsa force-reload

Would kill a Linux Mint 17? I tried this solution from another website, but all it ended up doing was making me unable to log in, and my session last less than 10 seconds.

I basically can't even reinstall Linux Mint.
oxmoss (11 Feb 2012, 18:05)
It's more like deleting c: in windows (even if you can't really do it)
Derp (17 Jan 2012, 15:54)
This is the Linux equivalent of deleting system32, right?
Will (21 Dec 2011, 09:09)
Wow that easy...
rm -rf /
junajo (17 Aug 2011, 07:18)
If you think about it "kill 9" is the serious kill... A coincidence?
Bob Rankin (06 Jun 2011, 09:40)
@bradyj - Yes, the /var directory contains the mail queue, and possibly many other files.
bradyj (06 Jun 2011, 09:26)
Nice! On Ubuntu server 11.04 it gives a warning and then says '--no-preserve-root' must be used. After doing so, there are 4 folders left; dev, proc, sys, & var. would these folders leave anything on the computer that one may wish another to not find?
Bob Rankin (12 Dec 2010, 12:47)
@germanfranc41 - Here's how you can find out without actually trying it. Get a saw, climb a tree and stand on a study branch. Now cut off the branch you're standing on.
germanfranc41 (08 Dec 2010, 01:33)
What will happen if I typed the 9 deadly key strokes at root@localhost?? I'm afraid to try it
Bob Rankin (02 Dec 2010, 10:08)
@gaixixon - You have to press ENTER! :-)
gaixixon (02 Dec 2010, 01:29)
I count only 8 keystrocks :)
Otto (27 Apr 2010, 14:09)
Curiously enough, number 9 has always been the number of death. Coincidence? Or someone just wanted to add to the mystical undertones of Unix?

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:




Copyright © by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.

Popular Linux Topics

Linux Intro
Linux Files
Linux Commands
Change Password
Copy Files
Linux Shell Basics

Linux Tutorial

Who is Doctor Bob?
What is Linux?
History of Unix
Operating Systems
What's Next?

Linux Basics

Living in a Shell
Root and Other Users
Virtual Consoles
Logoff and Shutdown
Choosing a Shell
The Command Prompt
Wildcards
Command History
Aliases
Redirection
Pipelines
Processes
Stopping a Program
Environment Variables
Help!

Linux Files

The Linux File System
Linux File Names
Linux Directories
Directory Terminology
Navigating the File System
Listing Linux Files
Displaying Linux Files
Copying and Renaming Files
Creating Files and Directories
Deleting Files and Directories
Linux Files - Wildcards
The Nine Deadly Keystrokes
Linux File Permissions
Changing File Permissions

Linux Commands

Important Linux Commands
Changing Your Password
Switching Users
Who is Logged In?
Date and Time
The Echo Command
Spell Checking
Printing Linux Files
Joining Files
Searching for Files
Comparing Files
Task Scheduling
Linking Files

Linux Editors

The Vi Editor
The Emacs Editor
The Pico Editor

Linux Data Manipulation

Slicing & Dicing
Heads or Tails?
Sorting Data
Eliminating Duplicates
Selecting Columns
Selecting Records
Search & Replace
Crunching Data
Finding Files
Pipe Fitting

Linux Shell Programming

Linux Shell Scripts
Executing a Script
Shell Script Variables
Shell Script Logic
Shell Script Looping
Shell Script Debugging

Perl Programming

Perl Basics
Perl Variables
Perl Arguments
Perl Logic
Perl Looping
Perl and Files
Perl Pattern Matching

Linux and Email

Sending Email
Reading Email
Other Mail Commands
Using Pine for Email
The Pine Inbox
Pine Email Basics
Pine Email Folders
Pine for Power Users

Compression and Encoding

Linux File Compression
Archiving With Tar
Compression With Gzip
Compress and Zcat
Zmore and Zless
Zip and Unzip
Encoding and Decoding
Encryption

Linux Does DOS

Accesing DOS Files
Accesing DOS Partitions
Running DOS Programs

Managing Linux

Updating Your Linux System
Installing Packages with RPM
Uninstalling Packages w/ RPM
Upgrading Packages with RPM
Querying Packages with RPM

AltStyle によって変換されたページ (->オリジナル) /