I think this is the issue
The old version of touch does not allow the creation of a filetime on a comparison file,
- for example the OP wants to be able to create a file with a filetime like this:
Where Nov 21 00:00 has to be dynamic, and is today's first second.
ctime is just the time the inode was changed - nothing else. It is not a create date - they do not exist in standard UNIX.
If the OP has perl v 5.8 you can write perl code to do this. I posted ancient POSIX.1 C code that does that and some other stuff - poorly. If we knew the OS and version it might help. If the OP could compile gnu version of touch that would be good.
I have recently taken on a new position and want to clean up several file locations that currently hold data back through 1999. While I need to keep this data for business reasons, I have created directories to help sort out the individual years. Is there a quick command that I can use to archive... (2 Replies)
Hi,
Can any one tell the command to list all the files that are created as of today from all the directories?
The Command "ls -ltR" is listing all the files.
But I want the list of files that has been created as of today along with the directory path:)
Thank you in advance.:)
Regards,... (4 Replies)
I need to figure out how to get all the files from a certian dir ./123/*sat files
and ./230/*sat files and several other directories which have these *sat files in them. I need to calculate how many were created today and how many yesterday from 2:00 pm on the 28th to 2pm on the 29th.
It's a... (1 Reply)
I have a listener (a batch job written in shell script) that calls a perl file (say apple.pl). The listener runs at scheduled timing (say 11 pm to 6 am)&.
Owner of the listener is a common id.
My question is..
Once the listener starts running (here, Im NOT attempting to generate any reports... (1 Reply)
Hello experts,
I have written following script to download files which created today.
Unfortunately, it's not working.
test.ksh:
#Defining variables
USR='xxx'
PASSWD='yyyy'
HT='test.test.com'
FILE='S*.pdf'
XFILE=$(echo find . -type f -mtime 0)
ZFILE=$(echo ls -tR|grep 'Jun 8')... (14 Replies)
Morning
My other issue I have seems very simple but im just not seeing it. I have a script that checks on a remote share to see if the backups for some systems have run. Its as simple as:
find /mnt/ukwcs-net-config/WLAN-Controllers/ -mtime -1 -ls | egrep '(cfg)' > wlanlog.txt
cut -c 1-92... (4 Replies)
Hi all,
In linux how to create a directory with specified size, so that it can be used only up to the mentioned size.
Actually my question is, whether we can do directory quota in linux.
mounting the directory in a partiton will do that, but do we have any other option... (1 Reply)
Hi, ALL
thanks in advance,
i listed all files using this command
ls -ltr $(date +%Y%m%d)*.xmlbut i would like to exclude the last one created ;
Best regard
MEROUAN
Use code tags, thanks. (4 Replies)
Hi,
I want to display the file names and the record count for the files in the 2nd column for the files created today.
i have written the below command which is listing the file names. but while piping the above command to the wc -l command
its not working for me.
ls -l... (5 Replies)
Discussion started by: Showdown
5 Replies
LEARN ABOUT SUSE
file::listing
File::Listing(3) User Contributed Perl Documentation File::Listing(3)NAME
File::Listing - parse directory listing
SYNOPSIS
use File::Listing qw(parse_dir);
$ENV{LANG} = "C"; # dates in non-English locales not supported
for (parse_dir(`ls -l`)) {
($name, $type, $size, $mtime, $mode) = @$_;
next if $type ne 'f'; # plain file
#...
}
# directory listing can also be read from a file
open(LISTING, "zcat ls-lR.gz|");
$dir = parse_dir(*LISTING, '+0000');
DESCRIPTION
This module exports a single function called parse_dir(), which can be used to parse directory listings.
The first parameter to parse_dir() is the directory listing to parse. It can be a scalar, a reference to an array of directory lines or a
glob representing a filehandle to read the directory listing from.
The second parameter is the time zone to use when parsing time stamps in the listing. If this value is undefined, then the local time zone
is assumed.
The third parameter is the type of listing to assume. Currently supported formats are 'unix', 'apache' and 'dosftp'. The default value
'unix'. Ideally, the listing type should be determined automatically.
The fourth parameter specifies how unparseable lines should be treated. Values can be 'ignore', 'warn' or a code reference. Warn means
that the perl warn() function will be called. If a code reference is passed, then this routine will be called and the return value from it
will be incorporated in the listing. The default is 'ignore'.
Only the first parameter is mandatory.
The return value from parse_dir() is a list of directory entries. In a scalar context the return value is a reference to the list. The
directory entries are represented by an array consisting of [ $filename, $filetype, $filesize, $filetime, $filemode ]. The $filetype value
is one of the letters 'f', 'd', 'l' or '?'. The $filetime value is the seconds since Jan 1, 1970. The $filemode is a bitmask like the
mode returned by stat().
CREDITS
Based on lsparse.pl (from Lee McLoughlin's ftp mirror package) and Net::FTP's parse_dir (Graham Barr).
perl v5.12.1 2008-09-24 File::Listing(3)