Remove only the ll alias from the current Bash.
Keep all other aliases.
Which command is appropriate?
unalias NAME removes one named alias. Adding -a removes every alias, so it must not be used when other aliases should remain.
Detailed explanation
unset llIncorrect. unset does not remove an alias definition.
Incorrect. unset does not remove an alias definition.
alias -aIncorrect. alias -a is not the Bash form for removing one alias.
Incorrect. alias -a is not the Bash form for removing one alias.
unalias -aIncorrect. unalias -a removes all aliases.
Incorrect. unalias -a removes all aliases.
unalias llCorrect. unalias ll removes only ll.
Correct. unalias ll removes only ll.
Try it yourself
An example you can run in a temporary verification environment.
bash --noprofile --norc -ic "alias ll='printf ok'; unalias ll; alias ll 2>/dev/null || echo removed"Expected result
removedKey points
- unalias NAME removes one
- -a removes all
- unset targets variables or functions
Notes
- Environment: GNU Bash 5.2 / 一時対話シェル
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.