0
0
Linux CLIscripting~10 mins

SCP for file transfer in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Auser@remote-server:/home/user
Bremote-server
C/home/user
Duser@remote-server
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.
2fill in blank
medium

Complete 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'
Ad
Br
Cp
DR
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.
3fill in blank
hard

Fix 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'
A:
B/
C@
D~
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.
4fill in blank
hard

Fill 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'
Auser@remote-server:
Buser@remote-server
C:
D/
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.
5fill in blank
hard

Fill 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'
A-r
Buser@remote-server
D-p
Attempts:
3 left
💡 Hint
Common Mistakes
Using -r unnecessarily for files only.
Omitting the colon after the remote server.
Confusing the order of arguments.