10 Most Dangerous Commands – You Should Never Execute on Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

33 Responses

  1. Alan labastida says:

    Other for the list:
    chmod 777 -R * on /

  2. braindeadLinux says:

    Linux is so brain dead. Running comamnds is like releasing a bull in a kitchen. On older systems with CLI, you would type a commandName and it would spit out instructions and easy to understand help. Something like the format command would stop and ask for input. If you wanted to automate, you could force confirmation within a batch file (ie, Continue (Y/n)? | Y – or something similar).

    So one would run a batch file for automated processing. When Linus decided to clone a unix-like OS, he didn’t bother to ask himself if he should improve it. He cloned garbage in and produced garbage out. All the s**t-grinning Unix users just nodded their heads and produced a community of Unix-like Linux users smiling that s**t-eating grin of conformity.

    To this day we’re still struggling with installing software using medieval techniques, producing 100s of distros – none of which are compatible with eachother for something that should be as simple as installing an app. Package managers that can’t even distinguish between a library or a program when searching for a programName like “editor”. Even if an editor is searchable within a PM, it doesn’t have a tagName of ‘editor’ and you need to know the exact weird, brain-dead name the developer gave it.

    I don’t even think I’ve ever seen a bashScript anywhere written with any kind of errorlevel checking. It’s just one line, followed by another. It assumes that everything on the system is exactly the same. It’s that same mentality of sloppy coding, sloppy programs that permeate this sloppy system. At least with some older CLI systems, it was common to write things like (IF exist… DO this… if NOT, skip and do something else). It’s no wonder Linux has never taken off. Even the most inane user recognizes garbage when they see it.

    When someone suggests making any change to the system that might benefit everyone in terms if functionality, the grey-haired Linux zombies come out. If there was any group of software users that can’t stand change (for the better), it’s Linux Desktop users.

    • ted smith says:

      You are so brain-dead.. Before you post anything:

      a) thank to the people spending time and energy to post such articles, first off. Learn to appreciate things.
      b) make sure you have enough knowledge about it.

      We all certainly understand your pain. Sounds like, hopeless.

  3. ihab says:

    What does that means #history | sh

  4. Derek Broughton says:

    Ten most dangerous you should NEVER execute on Linux?

    Eight out of ten are either stand-bys that any Linux admin should know AND use, or won’t do what you think they do (#4, as mentioned above, is perfectly safe).

    I’ll give you the fork bomb. Executing that would be pretty stupid. Though I’ll grant that you should always read the contents of any script you download with wget _before_ executing it.

    Otherwise, if you didn’t know what could happen why do you even have command line access?

  5. karan says:

    one more crontab -r

    keep backup of /var/spool/cron/root

  6. KJ says:

    4. mv folder /dev/null

    I doubt this is going to work, you will get an error message like:
    mv: target ‘/dev/null’ is not a directory
    or
    mv: cannot overwrite non-directory ‘/dev/null’ with directory ‘folder’

  7. some hacker says:

    If you know some linux you quickly learn that for many command “-v” means verbose and with that it show more of what’s going on
    now don’t use “-v” with pkill with the intent that you want to show what is killed or so
    pkill -v -u baduser
    you think you will see what is killed but since pkill comes from grep where “-v” means invert you kill every process _except_ those owned by baduser.
    Of course the basic rule is to not be logged in as root to start with and when having to do root stuff you “sudo pkill -u baduser”, then “rm -rf /” won’t be as bad.

  8. Satish says:

    Hi Avishek ,

    I can use the command like rm -rf *some log file* right ? Hope this will not delete the directory

  9. Eric says:

    Another interesting command that you should probably not run is “pkill -STOP -u root” …

  10. Rohan Khanolkar says:

    One more comment you have to add,

    #history | sh

    • Avishek Kumar says:

      @ Rohan Khanolkar,

      Thanks for the feedback. Please make a short note of what this command will do and we will add this to the article.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 150K+ Linux Users
  1. 100,756
  2. 5,113
  3. 36,418

Enter your email to get latest Linux Howto's