How to get the last file created on Linux using pscp PuTTY?
2014-07
I'm accesing an Ubuntu system using pcsp from PuTTY on a Windows PC. I need to retrive the last file created on a folder.
For now i only have a script that retrieves all the files on a folder:
set PATH=C:\Program Files (x86)\PuTTY;%PATH%
pscp
pscp [email protected]:unit_logs/* C:\Users\Zasil-Ha\Documents
How so I do to get the last file created on unit_logs folder???
Thank you in advance!
What you should do is to make a script the other way around. Push the latest file from Linux to Windows. To do this:
scp `ls -c|head -n1` user@windows_machine:<path>
I just installed Linux on my computer and tried connecting to it using PuTTY. The problem is that I keep getting "Connection Refused". Is there a simple fix, or is it something bigger?
You're getting this error because sshd (the SSH server/daemon) is not running on that computer.
How to start it depends on what distribution you're using on that computer. Please update your question to include that information.
You can also search the Web for "<distribution name> start sshd
" and see what comes up.
Oh, and before all this, make sure that you are trying to connect to the correct IP address. You can find out what IP address the computer has at the moment by running "ifconfig -a
" at the command prompt. You may have to run the command using sudo, like this: "sudo ifconfig -a
".