Bird
Raised Fist0
Intro to Computingfundamentals~6 mins

Copying, moving, and deleting files in Intro to Computing - Full Explanation

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Introduction
Imagine you have a collection of photos and documents on your computer. You want to organize them by making copies, moving some to different folders, or deleting the ones you no longer need. These actions help keep your files tidy and easy to find.
Explanation
Copying Files
Copying a file means making an exact duplicate of it in another location. The original file stays where it is, and a new copy appears where you want it. This is useful when you want to keep the original safe but also have a version elsewhere.
Copying creates a new file identical to the original without removing the original.
Moving Files
Moving a file means taking it from one place and placing it in another. Unlike copying, moving removes the file from its original location. This helps when you want to reorganize files without keeping duplicates.
Moving transfers a file to a new location and deletes it from the old one.
Deleting Files
Deleting a file means removing it from your computer. Usually, the file goes to a temporary storage called the recycle bin or trash, where you can restore it if needed. Emptying the recycle bin removes the file permanently.
Deleting removes a file, often first to a temporary bin before permanent removal.
Real World Analogy

Think of your files like physical papers on a desk. Copying is like making a photocopy of a paper and putting it in another folder. Moving is like taking the paper from one folder and placing it into another. Deleting is like throwing the paper into the trash bin.

Copying Files → Making a photocopy of a paper and placing it in a new folder while keeping the original
Moving Files → Taking a paper out of one folder and putting it into another folder
Deleting Files → Throwing a paper into the trash bin
Diagram
Diagram
┌─────────────┐       copy       ┌─────────────┐
│ Original    │───────────────▶│ Copy        │
│ File        │                │ File        │
└─────────────┘                └─────────────┘

┌─────────────┐       move       ┌─────────────┐
│ Original    │───────────────▶│ New Location│
│ File        │                │ File        │
└─────────────┘                └─────────────┘
       │
       │ (removed from original)
       ▼
    (No file here)

┌─────────────┐       delete     ┌─────────────┐
│ File        │───────────────▶│ Recycle Bin │
└─────────────┘                └─────────────┘
       │
       │ (empty bin)
       ▼
    (File gone)
This diagram shows how copying duplicates a file, moving transfers it and removes the original, and deleting sends it to a recycle bin before permanent removal.
Key Facts
CopyingCreates a duplicate file in a new location without removing the original.
MovingTransfers a file to a new location and deletes it from the original place.
DeletingRemoves a file, often first to a recycle bin before permanent deletion.
Recycle BinTemporary storage for deleted files allowing recovery before permanent removal.
Common Confusions
Thinking moving a file creates a copy and keeps the original.
Thinking moving a file creates a copy and keeps the original. Moving removes the file from its original location; it does not keep a copy there.
Believing deleting a file immediately removes it permanently.
Believing deleting a file immediately removes it permanently. Deleted files usually go to a recycle bin first, allowing recovery before permanent deletion.
Summary
Copying files makes duplicates without removing the original files.
Moving files transfers them to a new place and removes them from the old place.
Deleting files removes them, often first sending them to a recycle bin for possible recovery.

Practice

(1/5)
1. Which of the following best describes what happens when you copy a file on your computer?
easy
A. The file is renamed but stays in the same location.
B. The file is moved to a new location and removed from the original place.
C. The file is permanently removed from the computer.
D. A new file is created in the new location, and the original file stays where it is.

Solution

  1. Step 1: Understand copying

    Copying means making a duplicate file without deleting the original.
  2. Step 2: Compare with other actions

    Moving removes the original, deleting removes permanently, renaming changes the name only.
  3. Final Answer:

    A new file is created in the new location, and the original file stays where it is. -> Option D
  4. Quick Check:

    Copying duplicates file = A [OK]
Hint: Copying duplicates, original stays [OK]
Common Mistakes:
  • Confusing copying with moving
  • Thinking deleting is copying
  • Believing renaming moves the file
2. Which command correctly moves a file named report.txt from the folder Documents to Archives in a command-line interface?
easy
A. move Documents/report.txt Archives/
B. copy Documents/report.txt Archives/
C. delete Documents/report.txt Archives/
D. rename Documents/report.txt Archives/

Solution

  1. Step 1: Identify the move command

    The command to move files is usually move (Windows) or mv (Unix).
  2. Step 2: Check other commands

    copy duplicates, delete removes, rename changes name only.
  3. Final Answer:

    move Documents/report.txt Archives/ -> Option A
  4. Quick Check:

    Move command = move [OK]
Hint: Move command is 'move' or 'mv' [OK]
Common Mistakes:
  • Using copy instead of move
  • Using delete to move files
  • Confusing rename with move
3. Consider this Python code snippet using the shutil module:
import shutil
shutil.copy('data.txt', 'backup/data.txt')
shutil.move('data.txt', 'archive/data.txt')

What will happen after running this code?
medium
A. 'data.txt' is deleted from both 'backup' and 'archive'.
B. 'data.txt' is moved to 'backup', then copied to 'archive'.
C. A copy of 'data.txt' is made in 'backup', then the original is moved to 'archive'.
D. An error occurs because you cannot copy and move the same file.

Solution

  1. Step 1: Understand shutil.copy()

    This creates a duplicate of 'data.txt' in 'backup' folder; original remains.
  2. Step 2: Understand shutil.move()

    This moves the original 'data.txt' from current location to 'archive', removing it from original place.
  3. Final Answer:

    A copy of 'data.txt' is made in 'backup', then the original is moved to 'archive'. -> Option C
  4. Quick Check:

    Copy then move = C [OK]
Hint: Copy duplicates, move transfers original [OK]
Common Mistakes:
  • Thinking move duplicates file
  • Assuming copy deletes original
  • Believing both files are deleted
4. You wrote this command to delete a file:
del myfolder\file.txt
But you get an error saying the file is not found. What is the most likely cause?
medium
A. The file path is incorrect or the file does not exist.
B. The del command cannot delete files.
C. You need to copy the file before deleting it.
D. The file is already deleted, so the command fails.

Solution

  1. Step 1: Check file path and existence

    If the file path is wrong or file missing, deletion fails with 'not found' error.
  2. Step 2: Understand del command

    del deletes files; it works if file exists and path is correct.
  3. Final Answer:

    The file path is incorrect or the file does not exist. -> Option A
  4. Quick Check:

    File not found = wrong path or missing file [OK]
Hint: Check file path and existence first [OK]
Common Mistakes:
  • Assuming del cannot delete files
  • Trying to copy before deleting unnecessarily
  • Ignoring file path correctness
5. You want to organize your photos by moving all files from Downloads to Pictures, but keep a backup copy in Backup. Which sequence of actions correctly achieves this?
hard
A. Move all files from Downloads to Pictures, then copy all files from Downloads to Backup.
B. Copy all files from Downloads to Backup, then move all files from Downloads to Pictures.
C. Delete all files from Downloads, then copy files from Backup to Pictures.
D. Copy all files from Pictures to Downloads, then move files from Backup to Pictures.

Solution

  1. Step 1: Copy files to Backup

    Copying duplicates files to Backup folder, preserving originals in Downloads.
  2. Step 2: Move files to Pictures

    Moving transfers files from Downloads to Pictures, removing them from Downloads.
  3. Final Answer:

    Copy all files from Downloads to Backup, then move all files from Downloads to Pictures. -> Option B
  4. Quick Check:

    Copy backup first, then move original = B [OK]
Hint: Copy first to backup, then move originals [OK]
Common Mistakes:
  • Moving before copying loses original files
  • Deleting files before backup
  • Copying from wrong folders