Home > Article > Operation and Maintenance > bash scp: command not found solution
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.
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!