Bird
0
0

You want to create empty files for each month abbreviation (Jan, Feb, Mar) with .log extension. Which command is best?

hard📝 Application Q9 of 15
Linux CLI - File and Directory Operations
You want to create empty files for each month abbreviation (Jan, Feb, Mar) with .log extension. Which command is best?
Atouch {Jan,Feb,Mar}.log
Btouch Jan Feb Mar.log
Ctouch Jan.log,Feb.log,Mar.log
Dtouch Jan-Feb-Mar.log
Step-by-Step Solution
Solution:
  1. Step 1: Use brace expansion for multiple specific names

    Brace expansion with comma-separated values creates multiple files with given names and extensions.
  2. Step 2: Compare options

    touch {Jan,Feb,Mar}.log correctly creates Jan.log, Feb.log, Mar.log. touch Jan.log,Feb.log,Mar.log uses commas which is invalid. touch Jan Feb Mar.log creates files Jan, Feb, and a file named Mar.log. touch Jan-Feb-Mar.log creates one file named Jan-Feb-Mar.log.
  3. Final Answer:

    touch {Jan,Feb,Mar}.log -> Option A
  4. Quick Check:

    Brace expansion with commas creates multiple named files = C [OK]
Quick Trick: Use {a,b,c} to create multiple specific files quickly [OK]
Common Mistakes:
MISTAKES
  • Listing files without extensions
  • Creating one combined filename
  • Using commas instead of spaces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes