How to change runlevel in Linux with systemctl

Conventional method to change runlevel with /etc/inittab has changed. System and service manager command systemd is used. Runlevel have been replaced with targets. Although runlevel command, can still be used.

Below is comparison  of different runlevels and related targets

RunlevelExplanationCorresponding target
0Haltpoweroff.target
1Single user moderescue.target
3full multiuser with networking in text modemulti-user.target
5full multiuser with networking in graphical modegraphical.target
6Rebootreboot.target

View current runlevel

This command will show current runlevel

runlevel

change runlevel

List available targets

This command will show list of all loaded target

systemctl list-units --type target

change runlevelChange runlevel

Runlevel can be changed for current session or permanently default runlevel can also be changed.

Change current runlevel

To change current level to any other runlevel

systemctl isolate name.target

Change default run level

To change default runlevel

systemctl set-default <name of target>.target

Above commands replaces the /etc/systemd/system/default.target file with a symbolic link to /usr/lib/systemd/system/name.target.

These commands have been tested on fedora 25 and Redhat 7