Dangerous Terminal Commands

Discussion in 'macOS' started by Captain Awesome, Jul 2, 2009.

  1. Captain Awesome macrumors regular

    Joined:
    Jul 1, 2009
    Location:
    Vancouver/Tsawassen, Canada
    #1
    I was surprised to not find one of these threads here. Thought I might as well start one. Here is a list of commands you should NEVER run in Terminal unless you're sure what you are doing. There are fake tutorials around that will try and get you to run these:

    DO NOT PASTE THESE COMMANDS IN TERMINAL.

    1) Erase everything on hard drive with no warning:

    Code:
    rm -rf /
    Code:
    rm -rf *
    2) Erase everything in Home folder with no warning:

    Code:
    rm -rf ~/
    3) Instantly format current drive:

    Code:
    mkfs.(anything)
    4) Forkbomb. Will keep executing processes until the system freezes:

    Code:
    :(){:|:&};:
    Code:
    fork while fork
    5) Open every application in /Applications at once:

    Code:
    open /Applications/*
    Feel free to add to the list.
     
  2. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #2
    People who blindly execute Terminal commands without knowing what they mean deserve what they get.

    Most of those will also need a `sudo` to be the most harmful BTW
     
  3. techfreak85 macrumors 68040

    techfreak85

    Joined:
    Jan 13, 2008
    Location:
    Places
    #3
    will do nothing with out being root or Sudo. and i herd somewhere, but i have no clue the validity, that Apple changed the OS so you couldn't do
    Code:
    Sudo rm -rf /
    dont wanna try it :p
     
  4. okrelayer macrumors 6502a

    Joined:
    May 25, 2008
    #4
    this worries me. because, i am one of the people that will search the internet and find something that will "open all safari windows in tabs" or whatnot, and blindly paste the info into terminal. Although, i do try to stick to trusted mac hint/tip websites
     
  5. TuffLuffJimmy macrumors G3

    TuffLuffJimmy

    Joined:
    Apr 6, 2007
    Location:
    Portland, OR
    #5
    Don't do that then. Make sure you can read what a command is doing before you use it. For the most part though defaults write can't do much harm.
     
  6. sammich macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #6
    Awesome, I was looking for this baby (although I'd like the look of the one with foo instead)
    Apparently you need to run it for as many cores to really test it out? or was that the yes > null command?
     
  7. TuffLuffJimmy macrumors G3

    TuffLuffJimmy

    Joined:
    Apr 6, 2007
    Location:
    Portland, OR
    #7
    The fork bombs don't actually hurt your system though do they? won't they just crash the computer and a restart will fix everything?
     
  8. sammich macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #8
    Yeah, it basically a bottomless tree of threads. But it crashes your computer o so efficiently.

    EDIT: or not...all I get is a pile of "-bash: fork: Resource temporarily unavailable" and nothing.
     
  9. TuffLuffJimmy macrumors G3

    TuffLuffJimmy

    Joined:
    Apr 6, 2007
    Location:
    Portland, OR
    #9
    Same. Neither of those did anything for me, although I really didn't expect "fork while forking" to do anything.
     
  10. sammich macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #10
    There's some interesting reading up at http://en.wikipedia.org/wiki/Fork_bomb.

    for while fork is perl, which may run in terminal without extras but I can't remember how.
     
  11. mslide macrumors 6502a

    Joined:
    Sep 17, 2007
    #11
    While this is a nice idea, there are tons of "dangerous" unix commands. People who don't understand what they are doing shouldn't be playing around in terminal. Get a book about unix basics and read man pages. Even if someone here gives them a command to run (like I've done before), they should take the time to learn each and every part of it so they fully understand what it does.

    BTW, I like the fork bomb one.
     
  12. serytjbfxgnkies macrumors newbie

    Joined:
    Oct 28, 2015
    #12
    lolololol this is what im looking for

    I will definately run some of these on my friends computer
     
  13. Mikael H macrumors 6502

    Joined:
    Sep 3, 2014
    #13
    @Captain Awesome: Above quote is exactly why these threads aren't around...

    I'll reiterate what has already been said: Don't execute terminal commands without a rudimentary understanding of what they do. Any half-decent search engine will help you there.
    And whatever you do: If you play around with things that might cause data loss, keep backups of your data.
     
  14. old-wiz macrumors G3

    Joined:
    Mar 26, 2008
    Location:
    West Suburban Boston Ma
    #14
    Fooling around with *NIX commands without knowing exactly what happens is a recipe for disaster. When I was working we would have newbies who supposedly had CS degrees and were "fluent" with whatever *NIX and they would learn the hard way. It was kind of fun giving them a polite lecture on how not to wreck the system. Fortunately we always had multiple incremental backups offline so nothing was really damaged.
     

Share This Page