Bird
0
0

Which symbol is used in Bash to redirect the output of a command to a file, overwriting the file if it exists?

easy📝 Conceptual Q2 of 15
Linux CLI - Linux Basics and Terminal
Which symbol is used in Bash to redirect the output of a command to a file, overwriting the file if it exists?
A>
B|
C>>
D<
Step-by-Step Solution
Solution:
  1. Step 1: Identify output redirection symbols

    In Bash, > redirects output to a file, overwriting it. >> appends output. | pipes output to another command. < redirects input.
  2. Step 2: Match the symbol for overwriting output

    The symbol that overwrites a file with command output is >.
  3. Final Answer:

    > -> Option A
  4. Quick Check:

    Output redirection overwrite = > [OK]
Quick Trick: Use > to overwrite file, >> to append output [OK]
Common Mistakes:
  • Confusing > with >>
  • Using | instead of redirection
  • Using < for output redirection

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes