Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

File manipulation

Original Message
Name: scubaturtle
Date: March 30, 2007 at 07:07:53 Pacific
Subject: File manipulation
OS: solaris 2.6
CPU/Ram: 256m
Model/Manufacturer: Sun SPARC 20
Comment:
I need help in creating a script, or if there is command that would move all files from a directory if the time stamp for the file is less than 24hrs. It would be great if there were a command like sort/move files from today to $PATH. Thanks -ST


Report Offensive Message For Removal


Response Number 1
Name: Vertabreaker
Date: March 30, 2007 at 08:05:02 Pacific
Subject: File manipulation
Reply: (edit)
Do you want to move/copy the files to another directory if they're less then 24hours or remove them all together?

Report Offensive Follow Up For Removal

Response Number 2
Name: nails
Date: March 30, 2007 at 23:45:57 Pacific
Subject: File manipulation
Reply: (edit)
Let's cover how to find the files:

A common method for finding files created just today is to create a file at midnight, and use find's -newer option:

# find files modified on 03/30 to the current time
touch -t 200703300000 /tmp/neweroptionfile

find mydir -type f -newer /tmp/neweroptionfile -print

The above find command returns only files with a modification time after
midnight on 03/30/2007.

You can use the same method to find files modified within a given date range:

# find files modified in the first quarter of 2007
touch -t 200701010000 /tmp/newerstart
touch -t 200703312359 /tmp/newerend

find tmp \( -newer /tmp/newerstart -a \! -newer /tmp/newerend \) -print

The above command finds all files modified after the date of 'newerstart' and
not newer than 'newerend'.


Report Offensive Follow Up For Removal

Response Number 3
Name: scubaturtle
Date: April 2, 2007 at 07:15:53 Pacific
Subject: File manipulation
Reply: (edit)
Thanks for your help in explaining this. I will give try it out.

ST


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: File manipulation

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




My PC has been hijacked!

Lexmark 2600 Printer Issues

btk1w1 infected start here post

Unwanted message remians on screen

Slow boot time


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC