Bird
0
0

You want to create a new folder named backup inside your current directory and then move into it. Which sequence of commands will do this correctly?

hard📝 Application Q15 of 15
Linux CLI - Linux Basics and Terminal
You want to create a new folder named backup inside your current directory and then move into it. Which sequence of commands will do this correctly?
A<code>mkdir cd backup</code>
B<code>cd backup mkdir backup</code>
C<code>cd backup cd backup</code>
D<code>mkdir backup cd backup</code>
Step-by-Step Solution
Solution:
  1. Step 1: Create the folder first

    The command mkdir backup creates the folder named backup in the current directory.
  2. Step 2: Change directory into the new folder

    After creating it, cd backup moves you inside that folder.
  3. Step 3: Check other options

    cd backup mkdir backup tries to cd into backup before it exists, causing an error. mkdir cd backup misses the folder name in mkdir. cd backup cd backup tries to cd twice without creating the folder.
  4. Final Answer:

    mkdir backup cd backup -> Option D
  5. Quick Check:

    Create then cd = mkdir then cd [OK]
Quick Trick: Always mkdir before cd into new folder [OK]
Common Mistakes:
  • Trying cd before mkdir
  • Omitting folder name in mkdir
  • Repeating cd without folder

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes