Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to copy a file named file1.txt to file2.txt.
Linux CLI
cp file1.txt [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using options like -r when copying a single file.
Typing the wrong destination filename.
✗ Incorrect
The
cp command copies files. To copy file1.txt to file2.txt, you specify the source and then the destination filename.2fill in blank
mediumComplete the command to copy the directory docs and all its contents to backup_docs.
Linux CLI
cp [1] docs backup_docs Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the
-r option when copying directories.Using options that do not copy directories recursively.
✗ Incorrect
The
-r option tells cp to copy directories recursively, including all files and subdirectories.3fill in blank
hardFix the error in the command to copy file.txt to backup/ directory, preserving attributes.
Linux CLI
cp [1] file.txt backup/ Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-r alone does not preserve attributes.Forgetting to specify any option when copying directories.
✗ Incorrect
The
-a option copies files and directories preserving attributes like timestamps and permissions. It is useful for backups.4fill in blank
hardFill both blanks to copy all .txt files from source/ to dest/ with verbose output and prompt before overwrite.
Linux CLI
cp [1] [2] source/*.txt dest/
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-f which forces overwrite without prompt.Using
-r unnecessarily for files.✗ Incorrect
The
-v option shows each file copied. The -i option asks before overwriting files.5fill in blank
hardFill all three blanks to copy directory project/ to backup/ preserving all attributes, showing progress, and forcing overwrite.
Linux CLI
cp [1] [2] [3] project/ backup/
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-i instead of -f when forcing overwrite.Forgetting
-a to preserve attributes.✗ Incorrect
Use
-a to preserve attributes, -v to show progress, and -f to force overwrite without prompt.