Courseiva
Shells, Scripting and Data ManagementmediumMultiple SelectObjective-mapped

LPIC-1 Shells, Scripting and Data Management Practice Question

Which TWO commands can be used to sort the output of ps -ef by the resident set size (RSS) in descending order?

⚠ Common exam trap

Candidates often confuse the field number for RSS in `ps -ef` output (it is the 5th field, not the 3rd) and may overlook that `--sort=rss` defaults to ascending order, requiring a minus sign for descending.

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

ps --sort=-rss

Only option B is correct. `ps --sort=-rss` uses the native sorting feature of `ps`, which directly sorts by RSS in descending order (using the minus sign prefix for reverse). Options A and E are incorrect because `ps -ef` does not output RSS; its fields are UID, PID, PPID, C, STIME, TTY, TIME, CMD, so sorting by the 5th field (STIME) does not sort by RSS. Option C sorts by the 3rd field (PPID), not RSS. Option D sorts by RSS but in ascending order.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ps -ef | sort -k5,5 -rn

    Why it's wrong here

    Incorrect. `ps -ef` does not show RSS; the 5th field is STIME, not RSS.

  • ps --sort=-rss

    Why this is correct

    Correct. `--sort=-rss` sorts by RSS in descending order natively.

  • ps -ef | sort -k3 -rn

    Why it's wrong here

    Incorrect. The 3rd field in `ps -ef` is PPID, not RSS.

  • ps --sort=rss

    Why it's wrong here

    Incorrect. `--sort=rss` sorts by RSS in ascending order, not descending.

  • ps -ef | sort -k5 -rn

    Why it's wrong here

    Incorrect. `ps -ef` does not include RSS; the 5th field is STIME.

About these practice questions

One of 527 original LPIC-1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.