Courseiva
Shells, Scripting and Data ManagementeasyMultiple ChoiceObjective-mapped

LPIC-1 Shells, Scripting and Data Management Practice Question

Exhibit

$ set | grep -E ^BASH
BASH=/bin/bash
BASH_ALIASES=()
BASH_CMDS=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSION='5.0.0(1)-release'

Refer to the exhibit. An administrator wants to unset the BASH_ALIASES associative array. Which command will correctly remove it?

⚠ Common exam trap

Watch out — candidates often confuse `unset` with `export -n` or think a special flag like `-v` is required, when in fact `unset` alone is the correct and simplest way to remove any variable, including associative arrays.

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

unset BASH_ALIASES

`unset` is the standard Bash built-in command to destroy a variable or function. For an associative array like BASH_ALIASES, `unset BASH_ALIASES` removes the entire array, including all its key-value pairs, from the current shell environment.

Answer analysis

Option-by-option breakdown

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

  • export -n BASH_ALIASES

    Why it's wrong here

    export -n removes export property but does not unset the variable.

  • unset -v BASH_ALIASES

    Why it's wrong here

    unset does not accept -v; that is used with declare.

  • delete BASH_ALIASES

    Why it's wrong here

    delete is not a built-in command in Bash.

  • unset BASH_ALIASES

    Why this is correct

    Correctly unsets the variable or array.

About these practice questions

This LPIC-1 question is part of Courseiva's 527-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 →

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.