Mon, 05 Nov 2007, by [EMAIL PROTECTED]:

> I am looking for some bash scripts:
> 
> 1. I want to list all text files of one directory with a blank line in
> between.
> Currently I just use  grep "" *

for i in $(find ./ -maxdepth 1 -type f);do
   file $i| grep ASCII
   test $? -eq 0 && echo
done

> 2. I want to delete files older than x (e.g., 3 minutes, 3 hours, 3
> days, ...)

The creation time or date is not kept in Unix, so there's no sure way
of knowing how 'old' a file is, only when it was last accessed or
modified.

Theo
-- 
Theo v. Werkhoven    Registered Linux user# 99872 http://counter.li.org
ICBM 52 13 26N , 4 29 47E.     +      ICQ: 277217131
SUSE 10.2                      +   Jabber: [EMAIL PROTECTED]
Kernel 2.6.20                  +   See headers for PGP/GPG info.
Claimer: any email I receive will become my property. Disclaimers do not apply.
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to