How to start, restart and stop services in Linux / Debian

How to Start, Restart and Stop Services From the Command Line in Linux

How you start, restart, reload and stop services will depend upon whether your distribution uses init or systemd.
You can use the following commands as per your operating systems to manage a service.

systemctl commands (for Red Hat / CentOS version 7.x)

SYNOPSIS
systemctl [OPTIONS…] COMMAND [NAME…]

1.)  Start Service

systemctl start sshd

2.) Restart Service

systemctl restart sshd

3.) Stop Service

systemctl stop sshd

4.) Reload Service

systemctl reload sshd

5.) Check Service Status

systemctl status sshd

service commands (For Red Hat / CentOS version 4.x/5.x/6.x)

1.) Start Service

service sshd start

2.) Restart Service

service sshd restart

3.) Stop Service

service sshd stop

4.) Reload Service

service sshd reload

5.) Check Service Status

service sshd status

/etc/init.d/ commands (For Debian/Ubuntu)

In Debian/Ubuntu /etc/init.d/ or service commands can be used for starting, restarting and stopping services
1.) Start Service

/etc/init.d/sshd start

Or

service sshd start

2.) Restart Service

/etc/init.d/sshd restart

Or

service sshd restart

3.) Stop Service

/etc/init.d/sshd stop

Or

service sshd stop

That’s all for now. Don’t forget to provide me with your valuable feedback below in the comment section.

3 Comments

  1. anthony April 16, 2017
  2. Admin April 16, 2017
  3. Mike April 17, 2017

Add Comment