0
0
Linux CLIscripting~5 mins

SCP for file transfer in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does SCP stand for and what is its main use?
SCP stands for Secure Copy Protocol. It is used to securely transfer files between computers over a network using SSH.
Click to reveal answer
beginner
Write the basic SCP command to copy a file named report.txt from your local machine to a remote server at user@server.com in the /home/user/ directory.
The command is: <br>scp report.txt user@server.com:/home/user/<br>This copies report.txt from your local machine to the remote directory.
Click to reveal answer
intermediate
How do you copy a directory and all its contents using SCP?
Use the -r option to copy directories recursively. For example:<br>scp -r myfolder user@server.com:/home/user/<br>This copies the entire myfolder directory and its contents.
Click to reveal answer
beginner
What happens if you omit the destination path in an SCP command when copying to a remote server?
If you omit the destination path, SCP copies the file to the remote user's home directory by default.
Click to reveal answer
beginner
How can you copy a file from a remote server to your local machine using SCP?
Use SCP with the remote file as the source and local path as the destination. For example:<br>scp user@server.com:/home/user/report.txt ./<br>This copies report.txt from the remote server to your current local directory.
Click to reveal answer
Which SCP option allows copying directories recursively?
A-d
B-r
C-p
D-c
What protocol does SCP use to secure file transfers?
ASSH
BFTP
CHTTP
DTelnet
What is the default destination directory if none is specified in SCP when copying to a remote server?
AUser's home directory
B/root
C/tmp
D/var
How do you copy a file named data.csv from a remote server to your local machine?
Ascp data.csv user@server.com:/home/user/
Bscp ./data.csv user@server.com:/home/user/
Cscp user@server.com:/home/user/data.csv ./
Dscp user@server.com:data.csv ./
Which of these is NOT a valid SCP command?
Ascp file.txt user@host:/path/
Bscp -r folder user@host:/path/
Cscp user@host:/path/file.txt ./
Dscp -x file.txt user@host:/path/
Explain how to use SCP to transfer a directory from your local machine to a remote server.
Think about copying folders and how SCP secures the transfer.
You got /5 concepts.
    Describe the difference between copying files to a remote server and copying files from a remote server using SCP.
    Focus on which side (local or remote) comes first in the command.
    You got /4 concepts.