Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to copy a file named document.txt from your local machine to a remote server.
Linux CLI
scp document.txt [1]:/home/user/ Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to include the username before the @ symbol.
Using only the server name without the username.
Including the full path after the colon when it's already specified in the command.
✗ Incorrect
You need to specify the remote user and server in the format
user@remote-server to copy the file to the remote machine.2fill in blank
mediumComplete the code to copy a directory named project recursively from your local machine to the remote server.
Linux CLI
scp -[1] project user@remote-server:/home/user/ Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase
-R which is not valid for scp.Using
-p which preserves file attributes but does not copy directories.Omitting the recursive option when copying directories.
✗ Incorrect
The
-r option tells scp to copy directories recursively.3fill in blank
hardFix the error in the command to copy file.txt from the remote server to your local machine.
Linux CLI
scp user@remote-server[1]file.txt /home/localuser/ Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a slash instead of a colon after the server name.
Omitting the colon entirely.
Using the tilde or at symbol incorrectly.
✗ Incorrect
You must use a colon
: after the remote server to specify the remote file path.4fill in blank
hardFill both blanks to copy backup.tar.gz from the remote server to your local directory /backups.
Linux CLI
scp [1][2]backup.tar.gz /backups/
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Missing the colon after the remote server.
Not using the absolute path starting with slash.
Confusing the remote and local paths.
✗ Incorrect
The source must be specified as
user@remote-server:/backup.tar.gz. Here, user@remote-server: is the remote prefix and / starts the absolute path.5fill in blank
hardFill both blanks to copy all .log files from your local logs folder to the remote server's /var/logs directory.
Linux CLI
scp [1] logs/*.log [2]:/var/logs/
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
-r unnecessarily for files only.Omitting the colon after the remote server.
Confusing the order of arguments.
✗ Incorrect
The
-p option preserves file attributes. The destination must be specified as user@remote-server:/var/logs/.