Just removes everything

rm -rf --no-preserve-root /
when bad day comes...

0
By: thunder
2013-12-10 10:49:38

These Might Interest You

  • ... building upon Zhoul's EXCELLENT example... my 'expect' output had additional garbage. This script also: * converts the ESC-H sequence (reposition cursor) to new-line characters * removes BACKSPACES and BELLS * removes trailing spaces * removes NON-ASCII characters * and consolidates redundant lines (my input had multiple blank lines (100s))


    0
    cat $* | sed -e "s,\x1B\[[0-9;]*[H],+++NEWLINE+++,g" -e "s,\x1B\[[0-9;]*[a-zA-Z],,g" -e "s,+++NEWLINE+++,\x0A,g" -e "s,\x07,,g" -e "s,\x08,,g" | sed -e "s, *$,,g" -e "s,[^ -~],,g" | uniq
    quirkasaurus · 2016-09-09 15:32:32 0
  • Exactly the same effect with 3 less characters ;-) (Removes all files/filesystems of a harddisk. It removes EVERYTHING of your hard disk. Be careful when to select a device.) You can press Ctrl + C after few seconds (No output)


    -1
    cat /dev/zero > /dev/sda
    fhh · 2013-09-13 21:47:48 1
  • removes all files/filesystems of a harddisk. It removes EVERYTHING of your hard disk. Be carefull when to select a device. It does not prompt for and second check. Show Sample Output


    1
    dd if=/dev/null of=/dev/sda
    metaverse · 2013-08-30 21:06:36 0
  • -N removes header -s removes separator chars -r raw output After using these options, the MySQL ouptut can be used with pipes very easily Show Sample Output


    8
    mysql DATABASE -N -s -r -e 'SQL COMMAND'
    alperyilmaz · 2009-03-24 19:53:46 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: