What init 1 command exactly does?

84,817

Solution 1

ID  Name                                   Description
0   Halt                                   Shuts down the system.
1   Single-user mode                       Mode for administrative tasks.
2   Multi-user mode                        Does not configure network interfaces and does not export networks services.
3   Multi-user mode with networking        Starts the system normally.
4   Not used/user-definable                For special purposes.
5   Start the system normally with         Same as runlevel 3 + display manager.
    appropriate display manager (with GUI)                                         
6   Reboot                                 Reboots the system.

As you can see from the above each runlevel has what commands and programs run when started by user or any other process, as in the case of runlevel 1. Here only a single user can access the system and the commands here are barest at minimum, hence the comment that it freezes the system. Most commands you know in the 3-5 runlevel are not available here.

If you try entering this level from your current runlevel, you will see that a lot of things will not work and you most likely lose data in any open files or programs. Best tried on a virtual machine to see what it does.

Basically in Linux every runlevel is associated with certain programs or programs are associated with various runlevels. So entering that level with init 1 will kill all programs that are not designed or meant to be in that runlevel, hence the computer freeze mentioned by you.

Source: https://en.wikipedia.org/wiki/Runlevel

Solution 2

I am not a Linux programmer nor am I a hacker but I too have been watching Mr. Robot and came here for answer.

The line in the TV show was:

Darlene: "My computer kept crashing, and you (Elliot) told me to try init1"

Now I am a c++ programmer and electrical engineer so I checked online and got my answers here. Very simply it was because Darlene was using a higher runlevel and her computer would crash consistently being the cause of her frustrations. Elliot suggested to run the single user mode thus eliminating the networking and other users and allowing her to debug the program.

init1 became their codeword whenever she needed help.

Share:
84,817

Related videos on Youtube

Ahsan
Author by

Ahsan

Updated on September 18, 2022

Comments

  • Ahsan
    Ahsan over 1 year

    Well to be honest I love finding Loopholes in everything, I was watching a TV Serial Mr Robot and at some point a character mentioned init 1 command, that her computer started crashing again and again and she lost her mind after using that command. I am studying OS and I'm a beginner, I tried googling it and I've also checked many forums to get to know what this command actually does is.

    All I know is Linux have 0-6 run levels and init 1 is one of them, someone also mentioned that it freezes the computer, but I've not found the exact answer to my question that what this command actually does and how it works? And should I try it on my Computer?

    • George Udosen
      George Udosen about 7 years
      The question aught to be what do each of the run levels have to offer then you will know what happens when you launch any of them
    • user535733
      user535733 about 7 years
      Save your work first. Close unnecessary applications. Then try it and see what happens.
    • Ahsan
      Ahsan about 7 years
      init 1 is a Mode for administrative tasks. But the thing that keeps poking me is, how it makes a computer crash? I mean okay, it's admin mode, will you do anything but is that simple to crash a Linux server or Computer? @George
    • user535733
      user535733 about 7 years
      It's simple to crash ANY computer with the proper instructions. The hard part is getting the computer to obey your intent without error.
    • Ahsan
      Ahsan about 7 years
      @user535733 I've some important data stored in my computer, I really wanna try this at home, but do I've to transfer that data as well, I mean is it real? Am I going to lose all my data? Or just the current files that are open while running this command?
    • user535733
      user535733 about 7 years
      Running the command init 1 is unlikely to erase your disk.
  • Ahsan
    Ahsan about 7 years
    Well I know, I'm going of topic a bit but can you tell me why we don't use 2,4 run levels? And is it fine if I try the init 1 command on my computer?
  • George Udosen
    George Udosen about 7 years
    @Weaboo i have added an update version of the runlevels, please see levels 2 & 4 and why there are not used
  • Ahsan
    Ahsan about 7 years
    George I've another question, why you guys don't upvote questions here on @askUbuntu, I mean on stackoverflow we upvote almost all well defined questions :')
  • George Udosen
    George Udosen about 7 years
    @Weaboo we do upvote good questions. It just has to be good to get upvoted.
  • psusi
    psusi about 7 years
    I'm not sure where you got those definitions, but on Ubuntu, runlevels 2-5 are all identical.
  • George Udosen
    George Udosen about 7 years
    @psusi, yes I know there are but each have differences, source Linux Foundation SysAdmin Training Course...All similar in the fact there are all multi-user, but differ in network, nfs, text-login and gui.
  • Program man
    Program man over 5 years
    You are pretty much accurate and to add to your answer when you hit any init command system will go into that particular run level. So if you run init1 from the higher run level which by default any system boots in is init3 or init5 in case of GUI it will close everything that needs the multi-user support.
  • Program man
    Program man over 5 years
    also refer man page for runlevels as we are discussin init1, here is the init1 man page link man7.org/linux/man-pages/man1/stg-init.1.html
  • Program man
    Program man over 5 years
    also, refer to below article which explains every run level in brief and what it does or what's the purpose of it. linuxonfire.wordpress.com/2012/10/19/…
  • Kalamalka Kid
    Kalamalka Kid over 3 years
    Obviously the show had some good programmers there for all the info they had in the show. I wonder who they hired.