Bird
0
0

You try to run this command in terminal:

medium📝 Debug Q6 of 15
Linux CLI - Linux Basics and Terminal
You try to run this command in terminal:
cp file1.txt /backup/

But get an error: 'cp: cannot create regular file '/backup/file1.txt': Permission denied'. What is the likely fix?
ARun the command with sudo to get admin rights
BRename file1.txt to backup.txt
CUse 'mv' instead of 'cp' command
DDelete the /backup directory and try again
Step-by-Step Solution
Solution:
  1. Step 1: Understand permission error

    The error means you lack rights to write in /backup directory.
  2. Step 2: Use sudo for admin rights

    Running with 'sudo' grants temporary admin rights to copy the file.
  3. Final Answer:

    Run the command with sudo to get admin rights -> Option A
  4. Quick Check:

    Permission denied fix = use sudo [OK]
Quick Trick: Use sudo to fix permission denied errors [OK]
Common Mistakes:
MISTAKES
  • Trying to rename files instead of fixing permissions
  • Deleting directories unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes