svn deletes all .svn files
find . -name .svn -type d -exec rm -fr {} \;
Detailed explanation of linux's CP/scp command + scp command
Name: cp
Usage permissions: All users
How to use:
cp [options] source dest cp [options] source... directory
Note: Copy one file to another file, or copy several files to another directory.
Make a plan
-a Copy the file status, permissions and other information as much as possible as possible.
-r If the source contains the directory name, copy the files in the directory to the destination in sequence.
-f If the destination already has a file with the same file name, delete it before copying.
example:
Copy the archive aaa (already exists) and name it bbb:
cp aaa bbb
Copy all C programs to the Finished subdirectory:
cp *.c Finished
Command: scp
There are 3 common methods for copy files between different Linux:
The first one is ftp, which means that one of the Linux installs ftp Server, so that another client program can use ftp to copy files.
The second method is to use samba service, which is similar to Windows file copy, which is relatively simple and convenient.
The third type is to use the scp command to copy files.
scp is a file copy with Security, logged in based on ssh. It is more convenient to operate. For example, if you want to copy the current file to another remote host, you can use the following command.
scp /home/daisy/ [email protected]:/home/root
Then you will be prompted to enter the login password of the root user of the other 172.19.2.75 host, and then you will start copying.
If you want to operate the reverse operation, it is also very simple to copy the file from the remote host to the current system.
linux's cp/scp command + scp command detailed explanation (transformation) - linmaogan - single tree ★No Forest scproot@/ 172.19.2.75:/home/root/ home/daisy/
The scp command of linux can copy files and directories between linux;
==================
scp command
==================
scp can copy files between 2 Linux hosts;
Basic command format:
scp [Optional parameters] file_source file_target
======
Copy from local to remote
======
* Copy the file:
* Command format:
scp local_file remote_username@remote_ip:remote_folder
or
scp local_file remote_username@remote_ip:remote_file
or
scp local_file remote_ip:remote_folder
or
scp local_file remote_ip:remote_file
The first and second ones specify the user name, and you need to enter a password after the command is executed. The first one only specifies the remote directory, the file name remains unchanged, and the second one specifies the file name;
The third and fourth ones do not specify a user name. After the command is executed, the user name and password are required. The third one only specifies a remote directory, the file name remains unchanged, and the fourth one specifies a file name;
* example:
scp /home/space/music/1.mp3 root@:/home/root/others/music
scp /home/space/music/1.mp3 root@:/home/root/others/music/001.mp3
scp /home/space/music/1.mp3 :/home/root/others/music
scp /home/space/music/1.mp3 :/home/root/others/music/001.mp3
* Copy the directory:
* Command format:
scp -r local_folder remote_username@remote_ip:remote_folder
or
scp -r local_folder remote_ip:remote_folder
The first one specifies the user name, and you need to enter a password after the command is executed;
The second one does not have a user name specified, and the user name and password need to be entered after the command is executed;
* example:
scp -r /home/space/music/ root@:/home/root/others/
scp -r /home/space/music/ :/home/root/others/
The above command copy the local music directory to the remote others directory, that is, after copying, there is a remote ../others/music/ directory
======
Copy from remote to local
======
Copy from remote to local, just change the order of the last 2 parameters of the command copied from local to remote;
For example:
scp root@:/home/root/others/music /home/space/music/1.mp3
scp -r :/home/root/others/ /home/space/music/
The simplest application is as follows:
scp Local username @IP address: File name 1 Remote username @IP address: File name 2
[Local username @IP address:] You can not enter it, you may need to enter the password corresponding to the remote username.
Several parameters that may be useful:
-v means the same as -v in most linux commands, and is used to display progress. It can be used to view connections, authentications, or configuration errors.
-C Enable compression option.
-P Select port. Note -p has been used by rcp.
-4 Forced use of IPV4 address.
-6 Forced use of IPV6 address.
Note two points:
1. If the remote server firewall has special restrictions, the scp will have to go to a special port. The specific port is determined by the situation. The command format is as follows:
#scp -p 4588 remote@:/usr/local/ /home/administrator
2. When using scp, please pay attention to whether the user used has permission to read the corresponding files of the remote server.
SCP remote copy
SSH provides some commands and shells for logging into the remote server. By default it does not allow you to copy files, but it still provides a "scp" command. Suppose you want to copy a file named "dumb" in the current directory of the local computer to the remote serverGo to your home directory. And your account name on the remote server is "bilbo". You can use this command:
scp dumb bilbo@:.
Copy the file back with this command:
scp bilbo@:dumb .
The scp command is the most convenient and useful command in SSH. Just imagine, transferring files directly between two servers and using just one scp command will completely solve it.
You can run #scp servername:/home/ftp/pub/file1 on one server as root. This way, the file /home/ftp/pub/file1 on the other server is directly transmitted to the current directory of the machine. Of course, you can also use #scp /tmp/file2 servername:/boot to transfer the files on the machine
/tmp/file2 is sent to the /boot directory of another machine.
And the entire transmission process is still encrypted with SSH.
1: Copy the local file to the remote machine:
scp local file name [email protected]: Remote machine directory
Example: scp /home/test[email protected]:/home/testdir/
2: Copy files on the remote machine to the local area:
scp [email protected]: full path of file local directory
Example: scp[email protected]:/home/testdir/test /home/testdir/
scp [email protected]:/root/ ./
scp /home/cheney/ [email protected]:/home/root/
scp -r [email protected]:/mail/*./ (Copy all files in the entire directory)
You need to enter the corresponding username and password
Scp is a file copy with Security and is logged in based on ssh.
There are 3 common ways to copy files between different Linux:
The first one is ftp, which means that one of the Linux installs ftp Server, so that another client program can use ftp to copy files.
The second method is to use the samba service, which is similar to Windows file copying to operate, which is relatively simple and convenient.
The third type is to use the scp command to copy files.
The above content is the detailed explanation of the scp command in this article, and I hope it will be helpful to everyone.