Sponsored Content
Full Discussion: ls Help
Top Forums UNIX for Dummies Questions & Answers ls Help Post 82002 by bakunin on Friday 26th of August 2005 05:05:20 AM
Old 08-26-2005
Quote:
Originally Posted by rosh0623
This was good stuff.. but what do i do to find files that are older than today and move them to another folder. today's files should be there in the directory but older ones to be moved out !!..
The same what google already explained:

find /your/directory -type f -ctime +1 -exec mv {} /somewhere/else \;

This will take start in "/your/directory", find all files (-type f) which creation date (-ctime) is older than today (+1) and perform (-exec) the command stated up to the "\;" for every file found that way. The name of the found file will be set in plcae of the "{}".

Best thing to learn this comand is to try it out (replace the "mv" with something less intrusive) with different parameters and see what it does.

bakunin
 
sttime(3)						    ShapeTools Toolkit Library							 sttime(3)

NAME
stMktime, stWriteTime - date and time handling SYNOPSIS
#include <config.h> #include <sttk.h.h> time_tstMktime (char *string); char*stWriteTime (time_t date); DESCRIPTION
stMktime scans the given string and tries to read a date and time from it. It understands various formats of date strings. The following is a list of all valid formats, optional parts in brackets. [Tue] Jan 5[,] [19]93 This includes the standard asctime(3) format. Jan 5 With no year given, the year defaults to the current year. [19]93/01/05 This notation requires month and day represented by exactly two digits. 5.1.[19]93 This is the usual German notation. 5.1. German notation referencing the current year. A certain time, given together with the date must always have the following form. hours:minutes[:seconds] Each of the fields must be an integer value within the proper range (hours: 0-23, minutes and seconds: 0-59). Values below 10 may be written as one digit numbers. The time value may be placed anywhere in the date string: at the beginning, at the end, or somewhere in the middle. Any amount of white- space may be given between a field of the time value and the separating colon. The time is always considered to be local time. stWriteTime generates a time string similar to asctime(3) from its date argument. SEE ALSO
asctime(3) BUGS
Time Zone Names within the time string (like `MET') are not handled properly. In most cases they will cause a failure. sttk-1.7 Thu Jun 24 17:43:35 1993 sttime(3)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy