System Shutdown C Program For Linux Ubuntu

By | July 17, 2016

Code For System Shutdown C Program in Linux Ubuntu

Learn How To Code A System Shutdown C Program in Linux Ubuntu Operating System. This C Program To ShutDown Your Linux System makes use of Linux System Calls. This is an Auto Shutdown C Program which will Turn Off your System within the mentioned Time period in the parameters.

The system() method is defined in the Standard Library in C Programming. Hence, it is important to include stdlib.h header file.

The system() method takes in the following arguments:

  • Shutdown / Restart
  • Process / Cancel
  • Time Limit

You have the option to cancel the shutdown timer if you have activated it by executing the program given below. All you need is to type the following command.

C Program To Shutdown A Linux Ubuntu Operating System



System Shutdown C Program in Linux Ubuntu OS

If you have any compilation errors or doubts in the above C Program To Shutdown Your Linux Ubuntu System using PThread, let us know about in the Comment Section below.

Recommended Programs
C Program To Calculate Sum of N Numbers
C Program To Check Armstrong Numbers
Find Largest Digit in an Integer in C Programming
C Program To Find Arithmetic Progression
C Program To Print Hello World Without Using A Semicolon
C Program To Display Date and Time

2 thoughts on “System Shutdown C Program For Linux Ubuntu

  1. Ajay Sawant

    Will the same C Program to shutdown system work in Linux versions such as Mint, Fedora, Redhat?

  2. Rajesh Khan

    Yes. I tried it on Fedora PC. It works perfectly fine. I believe this code is executable in all the Linux distributions such as Fedora, Mint, OpenSUSE, Debian, Slackware, Arch and obviously Ubuntu, and many more.


Let's Discuss