Home  >  Article  >  Operation and Maintenance  >  bash scp: command not found solution

bash scp: command not found solution

不言
不言Original
2019-03-18 16:12:5210940browse

The scp command is used to transfer files between two servers via ssh. Most scp users can already use the scp command in their system, but it still shows "bash:scp:command not found". Therefore, note that the scp command must be available on both the local and remote systems to avoid this problem.

bash scp: command not found solution

Install the SCP command package

The scp command comes from the openssh-clients package on the Red Hat system, openssh-client package For Debian based systems. You can use the following command to install the scp command package on Linux operating systems.

CentOS/RHEL and Fedora

#yum install openssh-clients

Ubuntu and Debian

$ sudo apt-get install openssh-client

Transfer files using SCP commands

Local to remote: To To transfer the file /opt/myfile.txt from the local to the /opt/directory of the remote (remote.example.com) system, you can use the following command.

# scp /opt/myfile.txt remote.example.com:/opt/

Remote to local: To transfer the file /opt/myfile.txt from the remote (remote.example.com) system to the local system /opt directory, use the following command.

#scp remote.example.com:/opt/myfile.txt / opt /

This article has ended here. For more exciting content, you can pay attention to other related column tutorials on the php Chinese website! ! !

The above is the detailed content of bash scp: command not found solution. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn