scpHow to list files using SCP?
SCP (Secure Copy Protocol) is a secure file transfer protocol used to copy files between two computers over a network. It can be used to list files in a remote directory.
Example code
scp -l <username>@<hostname>:<remote_directory>
Output example
file1
file2
file3
Code explanation
scp
: command to initiate the SCP protocol-l
: flag to list files in a remote directory<username>
: username of the remote host<hostname>
: hostname or IP address of the remote host<remote_directory>
: path to the remote directory
Helpful links
More of Scp
- Running SCP in quiet mode
- How to show progress when using SCP?
- How to automatically create destination directory when using SCP?
- How to run SCP in verbose mode?
- How to enable logging when using SCP?
- How to transfer files using wildcards with SCP?
- How to use an SSH key when using SCP?
- How to transfer files recursively using SCP?
- How to SCP multiple files?
See more codes...