In the course of doing my job, I end up writing a lot of
utility programs. From time to time, I will post code here that
others have requested, or that I think others may find useful.
Enjoy!
Some utilities provided by others, named in description and/or source. |
Words of wisdom: |
Thought for the day:
|
Alphabetic index:
adddate: date arithmetic
age: date arithmetic
cronsched: a cron schedule printer
currepoch: print the current time in epoch
format (see also
cvtdat: print any given date in any format
epoch2time: convert seconds-since-epoch
to a timestamp
lsdate: (by Andy Cranston)
displays file modification date/time
rslvlnk: Resolve soft-link name
time2epoch: (by Bob
Vance) given mth, day, year, hour, min, sec - provide
epoch value
unfind: pipe (by Andy
Cranston) to remove pesky entries from stdin
![]() |
adddate.c
|
A utility to return a date in the future
or the past. Calculates the date by adding the first parameter to
the current date, then prints the result to standard output. The
number of days to add may be a negative number, allowing for
calculation of dates in the past. The format of the printed date
may be specified as the second parameter. If unspecified, the
output format will be like: Thu Jan 01 13:36:30 1998. See
man strftime for help with formatting.
adddate number_of_days [format_string]
|
![]() |
age.c
|
A utility to return the number of seconds
that have elapsed since a certain time.
age Month Day Year Hours Minutes Seconds |
![]() |
cronsched.c
|
A cron schedule printer. Reads the
specified crontab files, and produces a schedule report. Start time
and duration may be specified, as well as the users to be
considered. All valid crontab entry formats are accepted by this
program, and handled in the same manner as the standard Unix cron
processor.
cronsched [-b starttime] [-d duration (days)] [-w print_width] [-s crontab subdirectory] user [user ...] |
![]() |
currepoch.c | A utility to return the current time in
epoch format
currepoch Example:
|
![]() |
cvtdat.c
|
A utility to return any date in any
format. The month, day and year are passed as parameters, along
with an optional format string. If unspecified, the output format
will be like: Thu Jan 01, 1998. See man strftime
for help with formatting.
cvtdat Month Day Year[format_string] Example:
|
![]() |
epoch2time.c
|
A utility to return a date in in the
specified format, when the input value is elapsed seconds since
epoch. Some unix utilities return "epoch time" as their results,
and the purpose of this utility is to present that information in a
more human-friendly fashion.
epoch2time value [format_string] Example:
|
![]() |
lsdate.tar
|
A utility by Andy
Cranston to display the last modified date of one or more
files down to the exact second in a consistent and hence easily
parsed format.
lsdate [path][files] Example:
|
![]() |
rslvlnk.c
|
Resolves soft-link names to their
hard-link equivalent. Determines the hardlink name of any file, given the softlink name. Will trace down the "actual" name of any softlink, whether that link represents a directory name, regular file, or other filetype. In the cases where links point to links such as: aaa -> bbb -> ccc -> ... -> zzz this program will report the final, or actual filename in the list. Usage: rslvlnk linkname [linkname ...]
Examples:
|
![]() |
time2epoch.c
|
A utility by Bob
Vance to return the epoch value.
time2epoch [mm dd yy hh mm ss] Example:
|
![]() |
unfind.c
Man page |
A pipe by Andy Cranston
to remove name files and directories from stdin.
|
![]() There's no place like home |
Is there a utility you'd like to see? I may already have written it — or know where to find it. ![]() Write me to find out. |
visitors since July 8, 2008
Last updated: Oct 03, 2023 at 04:46PM America/New_York