Sponsored Content
Full Discussion: cp | greb
Top Forums Shell Programming and Scripting cp | greb Post 302667989 by bartus11 on Sunday 8th of July 2012 10:25:56 AM
Old 07-08-2012
statis used to read file's modification date and awk is used to filter files that were modified between 9:00 and 17:30. If this code gives you proper results, then you can copy those files using:
Code:
stat -c "%y %n" * | awk -F"[ :]" '$2>=9&&$2<17||$2==17&&$3<=30{print $6}' | xargs -i cp {} /somewhere/else

This User Gave Thanks to bartus11 For This Post:
 
i-ls(1) 						      General Commands Manual							   i-ls(1)

NAME
i-ls - display file stat and checksum information for files SYNOPSIS
i-ls [-s] filename i-ls [-s] dirname Specify a filename for i-ls to examine, or specify a directory with dirname to examine all the files in the directory. -s Do not show/calculate checksums for all regular files. DESCRIPTION
The integrit system detects intrusion by detecting when trusted files have been altered. integrit records information about files in a database. i-ls allows the user to see that information for live files. The output syntax is the same as that of integrit. EXAMPLES
i-ls /tmp/foo.txt shows file stat attributes for the file, "/tmp/foo.txt". i-ls /tmp shows file stat attributes for all files in the directory, "/tmp". i-ls -s /tmp shows file stat attributes for all files in the directory, "/tmp", also including also checksums for all regular files. AUTHOR
Ed L Cashin <ecashin@users.sourceforge.net> See the integrit web site for up to date releases and information at http://integrit.sourceforge.net/ SEE ALSO
Integrit File Verification System Manual (info), lstat(2) Version 4.1 Jul 27, 2001 i-ls(1)
All times are GMT -4. The time now is 03:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy