The current Bash has an ll alias.
Remove only ll and keep all other aliases.
Which command is appropriate?
unalias NAME removes the specified alias; unalias -a removes every alias.
Detailed explanation
unset llIncorrect. unset targets variables or functions, not aliases.
alias -a llIncorrect. alias does not use this form to remove an alias.
unalias -aIncorrect. unalias -a removes all aliases, not only ll.
unalias llCorrect. unalias ll removes just the named alias.
Try it yourself
An example you can run in a temporary verification environment.
bash --noprofile --norc -ic "alias ll='ls -l'; unalias ll; alias ll" 2>&1 | tail -n 1Expected result
ll: not foundに相当するエラーKey points
- unalias NAME
- -a removes all
- Different from unset
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.