LPIC-1 Administrative Tasks Practice Question
An administrator needs to display the current and previous runlevels of a Linux system. Which command provides this information?
⚠ Common exam trap
Candidates often confuse `who -r` with `runlevel` because both display the current runlevel, but `who -r` omits the previous runlevel, which is the key piece of information the question explicitly asks for.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
runlevel
The `runlevel` command displays both the previous and current runlevels of a Linux system. It outputs two characters: the first indicates the previous runlevel (or 'N' if the runlevel has not changed since boot), and the second indicates the current runlevel. This is the standard tool for querying runlevel information on SysV init systems.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
who -r
Why it's wrong here
who -r reports only the current runlevel, omitting the previous one. It is tempting as a quick runlevel check, but the runlevel command (or last -x runlevel) prints both current and previous levels, which the question requires.
- ✓
runlevel
Why this is correct
runlevel reads /var/run/utmp and prints the previous and current SysV runlevels, matching the requirement to show both. It reports N when no previous level exists, and works only where the legacy runlevel records are maintained.
- ✗
telinit 1
Why it's wrong here
telinit 1 changes the system to runlevel 1 rather than reporting anything, so it cannot display current and previous runlevels. It tempts because telinit queries or alters runlevels, but its query mode requires the -q flag, and even then it reports only the current runlevel.
- ✗
init 0
Why it's wrong here
init 0 halts the system by switching to runlevel 0; it reports no runlevel data. The command is tempting because init controls runlevels, yet displaying current and previous runlevels requires who -r, which reads the utmp record rather than changing state.
Go deeper
Related to this question
About these practice questions
This LPIC-1 question is part of Courseiva's 402-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.