DANGEROUS COMMANDS THAT YOU SHOULD NEVER TRY ON LINUX

Linux command line is useful and interesting but sometimes it may be very dangerous , when you are not sure what you are doing. Linux commands are powerful, and Linux won’t ask you for confirmation if you run a command that will put your system at risk or if you enter something that will delete your files then it will not ask for permission once command entered then it will work on it. This article is not intended to make you furious of Linux. I just want to make you aware of some commands which you should think twice before you execute them.

 COMMANDS

  1. Rm –rf / command
  • rm –rf / – Delete everything, one of fastest way to delete a folder and its content. Nut little ignorance may result into unrecoverable system damage. This command is more understandable if its broken down.
  • rm command in linux is used to delete files.
  • rm -r command deletes the folder recursively, even the empty folder.
  • rm -f command removes ‘read only file’ without asking.
  • rm -rf / : force deletion of everything in root directory.
  • rm –rf * : force deletion of everything in working directory.

 

  1. :(){:|:&};: command
  • This command is actually a fork bomb. operates by defining ‘:’, which calls itself twice, once in foreground and once in the background. It keeps on executing again and again till the system freezes.

 

  1. ext4 /dev/sda1 – Formats a Hard Drive
  • ext4 – on the following device it creates a new mkfs.ext4 file system
  • /dev/sda1 – specifies the first partition on the first hard drive, which is probable is use.
  • Taking both command together, this command can be equivalent to running format c: on windows – it will wipe the files on your first partition and replace them with new file system.
  • ext3 /dev/sd2 would format the second partion on the second hard drive with the ext3 file system

 

  1. Command > /dev/sda
  • The above command will move ‘folder’ to /dev/null. In linux /dev/null or null device is a special file that discards all the data written to it reports that write operation succeed.

 

  1. mv ~ /dev/null – Moves your home Directory to a black hole
  • /dev/null is another location – moving something to /dev/null is the same thing as destroying it. Think of /dev/null as a black hole. mv ~ /dev/null sends all your personal files into black hole.
  • mv – move the following file or directory to another location.
  • ~ – represents your entire home folder.
  • /dev/null – move your home folder to /dev/null, destroying all your files and deleting the original copies.

 

  1. dd if=/dev/random of=/dev/sda – writes junk onto a Hard Drive
  • The dd if=/dev/random of=/dev/sda line will also onlierate the data on one of your hard drives.
  • dd – perform low-level copying from one location to another.
  • If=/dev/random – use /dev/random (random data) as the input – you may also see locations such as /dev/zero (zeros).
  • Of=/dev/sda – output to the first hard disk, replacing its file systemwith random garbage data.

 

  1. wget http://example.com/something – o -| sh – Downloads and Runs a script
  • The above line downloads a scrit from the web and sends it o sh, hich executes the contents of the script. This can be dangerous if you’re not sure what the scrit is or if you don’t trust its source – don’t run untrusted scripts.
  • wget – Downloads a file.
  • http://example .com/something – Download the file from this location.
  • | – pipe the output of the wget command directly to another command
  • Sh – send the file to the sh command. Which executes it if it’s a bash script.

 

  1. > file
  • The above command is used to flush the content of file. If the above command is executed with the ignorance like “> xt.conf” will write the configuration file or any other system or congiration file.

 

2 thoughts on “DANGEROUS COMMANDS THAT YOU SHOULD NEVER TRY ON LINUX

  • April 11, 2017 at 5:48 am
    Permalink

    hii there very nice article,
    thanks for sharing

    Reply

Leave a Reply

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