![]() ![]() Sometimes you want to copy not just a single file but a directory Even so,Įscape your wildcard characters if you want your local shell to leave Sshregex manpage for SSH2 (see Appendix A, "SSH2 Manpage for sshregex") describes the supported operators. scp2 does its own regular expression matchingĪfter shell-wildcard expansion is complete. ![]() AlwaysĮscape your wildcards so they are explicitly ignored by the shell and This coincidental behavior shouldn't be relied on. Scp1, and the copy may succeed as planned, but Match in the current directory, will pass the unexpanded wildcard to Scp1 is invoked, but the current directoryĬontains no filename matching ":*.txt".Ĭ shell and its derivatives will report "no match" and The Unix shell attempts to expand the wildcard before For example, thisĪttempt is likely to fail: $ scp1 :*.txt. Watch out for wildcards in remote file specifications, as they areĮvaluated on the local machine, not the remote. It simply lets the shell expand them: $ scp *.txt : Handling of Wildcards scp for SSH1 and OpenSSH has no special supportįor wildcards in filenames. Only if username is omitted and path is presentħ.5.2. $ scp as above, but copying from bob's to jen's account Table 7-3 summarizes the syntax of an Here are a few complete examples: $ scp myfile myfile2 Path) The file ~bob/dir/MyFile on The file /dir/MyFile on (although youĪuthenticate as bob, the path is absolute) #2000: The remote user's home directory on, via TCP port 2000 Home directory on :/dir/MyFile The file /dir/MyFile on (note the absolute ![]() The trailing colon again) The file ~bob/MyFile on :dir/MyFile The file dir/MyFile in the remote user's The current directory on localhost : The directory ~username on A local file named "" (oops: did youįorget the trailing colon - a common mistake) :MyFile The file MyFile in the remote user's homeĭirectory on The directory ~bob on A local file named (oops forgot MyFile on localhost MyDirectory The directory. Either the hostname (2) or the directory path (3) must be present. If omitted entirely, the path isĪlthough each field is optional, you can't omit them all at the Relative to the default directory, which is theĬurrent directory (for local paths) or the user's homeĭirectory (for remote paths). (Optional if the hostname is present.) Relative pathnames are assumed
0 Comments
Leave a Reply. |