Several methods of infinite Linux restart

Source: Internet
Author: User

Hello everyone, October a holiday after more than half son, is not feeling the time to live particularly fast? Today I bring you a good thing: several ways to let Linux system restart indefinitely


Applicable system : Centos/rhel (Other systems to try)

User Identity : Must be root


1. Direct modification of source files with sed command for unlimited reboots

[[email protected] ZYJTF 孤云暮雨 ~]# sed -i ‘s/id:[0-9]:initdefault:/id:6:initdefault:/‘g /etc/inittab && reboot


2. use sed command + regular expression to modify the source file for infinite restart

[[email protected] zyjtf  Lone Cloud Twilight  ~] # sed -i  ' s/id:[[:d igit:]]:initdefault:/id:6:initdefault:/' g /etc/inittab &&  reboot


3. use SED command + extended regular (or relationship) to modify the source file for unlimited restart

[[email protected] zyjtf  Lone Cloud Twilight  ~] # sed -i -r  ' s/id: (3|5): initdefault:/id:6:initdefault:/' g /etc/inittab & & reboot


4. Rewrite "/etc/inittab" file for unlimited reboots

[Email protected] ZYJTF Lone cloud Twilight Rain ~]# cat/dev/null >/etc/inittab && echo ' id:6:initdefault: ' >/etc/inittab &A mp;& reboot



All right, I finished, the above command, for reference only, do not use to do bad things

This article from "ZYJTF Lone Cloud Twilight Rain" blog, declined reprint!

Several methods of infinite Linux restart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.