Is there an scp variant of mv command?
You could use rsync
with --remove-source-files
:
rsync -avz --remove-source-files /local/dir/*.jpg user@ip:/remote/dir
Copying files from server to local computer using SSH
It depends on what your local OS is.
If your local OS is Unix-like, then try:
scp username@remoteHost:/remote/dir/file.txt /local/dir/
If your local OS is Windows ,then you should use pscp.exe
utility.
For example, below command will download file.txt from remote to D:
disk of local machine.
pscp.exe username@remoteHost:/remote/dir/file.txt d:\
It seems your Local OS is Unix, so try the former one.
For those who don't know what pscp.exe
is and don't know where it is, you can always go to putty
official website to download it. And then open a CMD prompt, go to the pscp.exe directory where you put it. Then execute the command as provided above
EDIT
if you are using Windows OS above Windows 10, then you can use scp
directly from its terminal, just like how Unix-like OS does.
Thanks to @gijswijs @jaunt @icanfathom
Copying a local file from Windows to a remote server using scp
If your drive letter is C, you should be able to use
scp -r \desktop\myfolder\deployments\ user@host:/path/to/whereyouwant/thefile
without drive letter and backslashes instead of forward slashes.
You are using putty, so you can use pscp. It is better adapted to Windows.
Linux mv command with time adding spaces
Thanks. All it seems it was the encoding was incorrect the line endings were not set to unix. I develop on a windows machine and deploy to the server which messed up the line endings.
Is there a SCP alternative for PowerShell?
pscp.exe
is a viable option, but I have been using a library from Rebex for a couple years now for SFTP and FTPS transfers in both C# apps and PowerShell scripts with great success. Their package also includes an SCP object but I haven't personally used it.
It does cost money vs. pscp
being free. Before selecting the Rebex package, I had considered going the PuTTY route but my team decided that having a library we could easily roll into any app/script was worthwhile in the long term.
Related Topics
How to Change the Language of My Git
Jna Link Issue While Starting Cassandra Rhel 6.5
Debugging Shared Libraries Remotely with Gdb/Gdbserver
Catching a Direct Redirect to /Dev/Tty
How to Use a Seq_File in Linux Kernel Modules
Run a Command Conditionally with Netcat and Grep
Sed Permission Denied When Overwriting File
How to Determine If Pipe Can Be Written
Compile Linux Kernel (2.6) Module Including Non Kernel Headers
Case in Bash: "Line 4: Syntax Error Near Unexpected Token ')'"
Linux Serial Port Buffer Not Empty When Opening Device
Python Read Linux Memory Process Error (/Proc/$Pid/Mem)
How to Wait for a Keystroke Interrupt with a Syscall on Linux
Where Did Wireshark/Tcpdump/Libpcap Intercept Packet Inside Linux Kernel
Passing Arguments to a Script Invoked with Bash -C
What Do the Suffixes "+" and "-" After the Job Id of Background Jobs Mean