Solved

Plink get today's files to txt file

Posted on 2014-01-15
2
671 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 29

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

740 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