Bird
0
0

You want to create a directory named backup inside your home folder and then create an empty file log.txt inside it. Which sequence of commands achieves this?

hard📝 Application Q8 of 15
Linux CLI - Linux Basics and Terminal
You want to create a directory named backup inside your home folder and then create an empty file log.txt inside it. Which sequence of commands achieves this?
Acd ~ mkdir backup touch backup/log.txt
Bmkdir backup cd backup touch log.txt
Ctouch backup/log.txt mkdir backup
Dcd backup mkdir log.txt
Step-by-Step Solution
Solution:
  1. Step 1: Navigate to home directory

    cd ~ moves to the home folder.
  2. Step 2: Create 'backup' directory and file inside it

    mkdir backup creates the folder, then touch backup/log.txt creates the file inside it.
  3. Final Answer:

    cd ~; mkdir backup; touch backup/log.txt -> Option A
  4. Quick Check:

    Create folder then file inside with correct paths [OK]
Quick Trick: Create folder first, then file inside using full path [OK]
Common Mistakes:
MISTAKES
  • Creating file before folder
  • Wrong cd location
  • Using mkdir for files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes