We can use various runlevels for various tasks, as we've seen earlier in this chapter. Let's use the CentOS 6.5 distribution. To see the runlevel at the shell in real time, we can use the runlevel command:
[philip@localhost Desktop]$ runlevel
N 5
[philip@localhost Desktop]$
From the preceding output, the N means the previous runlevel. In our case, we have not changed the runlevel. The 5 indicates we are currently in runlevel 5. We can also run another command to display the runlevel. We can use the who command with the -r option, as can be seen here:
[philip@localhost Desktop]$ who -r
run-level 5 2018-06-20 08:09
[philip@localhost Desktop]$
From the preceding output, we can see a further description, namely run-level 5 using the who –r command.
Now, we can change the runlevel in our CentOS 6.5 distribution by leveraging the init or telinit...