Difficulty: Easy
Correct Answer: None of the above
Explanation:
Introduction / Context:
Terminal line editing in Unix/Linux shells (such as bash or zsh) supports special control keys that edit what you have typed before you press Enter. A common need is to wipe the entire line quickly—useful when you have typed a long, wrong command. This question checks whether you know the correct mechanism and clarifies why ordinary punctuation symbols are not used for this purpose.
Given Data / Assumptions:
Concept / Approach:
Unix terminals recognize control characters for line editing. The classic key to erase the entire line is Control-U (often shown as ^U), also referred to as the 'kill line' function. Other related keys include Control-W (delete previous word) and Control-A / Control-E (move to start/end of line). These are not printable symbols like '!', '$', '#', or '@'; they are control keystrokes interpreted by the terminal driver. Therefore, none of the listed symbols perform the requested 'kill whole line' action.
Step-by-Step Solution:
Verification / Alternative check:
Use the command 'stty -a' to list your terminal's erase/kill bindings. You should see 'kill = ^U' by default. You can also remap with 'stty kill \^c' (not recommended) and test again to confirm that it is the control binding—not a punctuation symbol—that clears the line.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing shell editing with editor keymaps (like in vi), expecting Backspace to be faster for long lines, or thinking printable symbols can serve as control bindings without configuring 'stty' or readline.
Final Answer:
None of the above
Discussion & Comments