Solved

Plink get today's files to txt file

Posted on 2014-01-15
2
657 Views
Last Modified: 2014-01-20
What command should i use to get written off to a local text file all the files created "Today" (not the las 24 hours, but al the files created after 00:00 the current day), ordered by name?

would it be something like..

plink -P port -l user -pw pass machineName  "command here" >> myfile.txt 2>&1
0
Comment
Question by:celtician
2 Comments
 
LVL 4

Assisted Solution

by:popesy
popesy earned 200 total points
ID: 39784760
Hi

You could try the 'stat' command in linux (I think this depends on your disto however).

For the stat command try;

stat -c %W filename

or

stat -c %w filename

It doesn't look like you are after a command for an AIX platform here, as you can get the creation time from the file system database that JFS2 provides.

Good luck

Cheers, JP.
0
 
LVL 27

Accepted Solution

by:
serialband earned 300 total points
ID: 39786818
Plink thinks that your redirect is part of the command being passed to the remote hose.  You need to put parenthesis around the command and redirect that output to your local windows system.
(plink -P port -l user -pw pass machineName  "command here") >> myfile.txt 2>&1


Did you just want to copy a file from the server to your Windows system?  You would use pscp.exe for that.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now