10-19-2017
The find command with the -mtime and -maxdepth options can do that for you.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a program that will export my data to a single file, but it assigns a file name that is overridden every time I run the program. I need to change the file name to have a sequential number in the filename.
How do I rename a file so that the filename contains the system date and time. I want... (5 Replies)
Discussion started by: wayneb
5 Replies
2. UNIX for Dummies Questions & Answers
Hi Guys,
I need to script the renaming of files as followins:
files:
firstjd
secondjo
thirdjv
My script needs to insert the date/time infront of the last 2 characters of the filenames above, any ideas greatly received :)
the letters before the last 2 characters could change, I'm only... (7 Replies)
Discussion started by: cooperman
7 Replies
3. UNIX for Advanced & Expert Users
Hi,
I operate and use HF radars along the California coast for ocean surface currents. The devices use Mac OS as the control and logging software. The software generates thousands of files a week and while I've used PERL in the past to solve the problems of finding files I come to realize some... (6 Replies)
Discussion started by: dpath2o
6 Replies
4. UNIX for Dummies Questions & Answers
I need to edit the file name with date and time while writing the script.
please help. (1 Reply)
Discussion started by: manish.s
1 Replies
5. Shell Programming and Scripting
Hi, i have a filename CRED20102009.txt in a server
20102009 is the date of the file ddmmaaaa format
the complete route is
/dprod/informatica/Fuentes/CRED20102009.csv
i want to extract the date to create a new file named Parameters.txt
I need to create Parameters.txt with this... (6 Replies)
Discussion started by: angel1001
6 Replies
6. Shell Programming and Scripting
I have lots of files in this format:
dvgrab-2003.06.29_15-30-24.mpg
The numbers represents the date and time (YYYY.MM.DD_HH-MM-SS)
How can I extract the dates from the filenames, and use the dates in the file timestamp?
I guess this can be done by using "find", "sed" and "touch"?
Can... (6 Replies)
Discussion started by: qwerty1234
6 Replies
7. Shell Programming and Scripting
Hi,
There are similar kind of posts, but none seems like working for me. Please correct me if I'm wrong.
I need append/rename file abc.txt with file processed date and time like abc_systemdatetimestamp.txt
and move it to different folder.
for example I have
/source/data/abc.txt
... (1 Reply)
Discussion started by: amsn08
1 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I have incoming source files abcmmyy.txt I need to extract the mmyy part from the filename and pass that to a variable . I really appreciate your quick response on this.
Thanks
raj (7 Replies)
Discussion started by: rajeevm
7 Replies
9. Shell Programming and Scripting
hi
i want to validate the date and time in filename
filename : mohan.moh.ccyymmdd.ccyymmdd.hhmmss.txt
mohan_moh.20151222.20151222.122442.txt
i want code that check that date given in filename 20151222 in this format ccyymmdd else it mark file is not valid used in my OS detail is AIX 6... (12 Replies)
Discussion started by: MOHANP12
12 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I am facing one scenario in which I need to extract exact position of date and time from the name of the files. For example, Below is the record in which I need to extract position of YYYYMMDD,HHMISS and YYMMDD. Date and time variables can come more than once. I need to use these position... (13 Replies)
Discussion started by: Prathmesh
13 Replies
LEARN ABOUT DEBIAN
ost_dirtree
ost::DirTree(3) Library Functions Manual ost::DirTree(3)
NAME
ost::DirTree -
A generic class to walk a hierarchical directory structure.
SYNOPSIS
#include <file.h>
Public Member Functions
DirTree (const char *prefix, unsigned maxdepth)
Construct a directory tree walk starting at the specified prefix.
DirTree (unsigned maxdepth)
Construct an un-opened directory tree of a known maximum depth.
virtual ~DirTree ()
void open (const char *prefix)
Open a directory tree path.
void close (void)
Close the directory path.
char * getPath (void)
Extract the next full pathname from the directory walk.
unsigned perform (const char *prefix)
This is used to step through the filter virtual for an entire subtree, and is used for cases where a derived DirTree class performs
it's primary operations through filter rather than externally by calling getPath().
Protected Member Functions
virtual bool filter (const char *file, struct stat *ino)
Virtual method to filter results.
Detailed Description
A generic class to walk a hierarchical directory structure.
Author:
David Sugar dyfet@ostel.com Directory tree walking.
Constructor & Destructor Documentation
ost::DirTree::DirTree (const char *prefix, unsignedmaxdepth)
Construct a directory tree walk starting at the specified prefix. A maximum subdirectory depth is also specified.
@param prefix to start walk.
@param maxdepth subdirectory depth to examine.
ost::DirTree::DirTree (unsignedmaxdepth)
Construct an un-opened directory tree of a known maximum depth. Parameters:
maxdepth subdirectory subdirectory depth.
virtual ost::DirTree::~DirTree () [virtual]
Member Function Documentation
void ost::DirTree::close (void)
Close the directory path.
virtual bool ost::DirTree::filter (const char *file, struct stat *ino) [protected], [virtual]
Virtual method to filter results. Virtual override methods should call baseclass method to assure . and .. names are stripped out.
Returns:
true if current filename is accepted.
Parameters:
file path to examine
ino info of type, date, etc.
char* ost::DirTree::getPath (void)
Extract the next full pathname from the directory walk. When returning directories, a '/' is appended. The returned string is a buffer of
MAX_PATH size.
Returns:
path of next subdirectory entry or NULL.
void ost::DirTree::open (const char *prefix)
Open a directory tree path. Parameters:
prefix directory path to open.
unsigned ost::DirTree::perform (const char *prefix)
This is used to step through the filter virtual for an entire subtree, and is used for cases where a derived DirTree class performs it's
primary operations through filter rather than externally by calling getPath(). Returns:
number of files and directories examined.
Parameters:
prefix directory path to examine.
Author
Generated automatically by Doxygen for GNU CommonC++ from the source code.
GNU CommonC++ Sat Jun 23 2012 ost::DirTree(3)