Re: unix question

  • From: "Bill Gallik" <BillGallik@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 7 Oct 2010 13:05:53 -0500


--------------------------------------------------
From: "Lafond, Eileen" <Eileen.Lafond@xxxxxxxxxxx>
Sent: Thursday, October 07, 2010 12:20 PM
To: <programmingblind@xxxxxxxxxxxxx>
Subject: RE: unix question

Hi,
Iwas successful with the following find command for deleting the .log files older than 30 days and then I changed the ls to rm -f and removed them successfully.

My question now is is there a way to incoorporate in this code a way to count the number of the output files when I do the find ls command? I have found several commands but they appear to be only for counting the files in a directory.

My code follows:
find '/home/faserv/hrprod/cron/logs' -name '*.log' -type f -mtime +30 -exec ls {} \;

Eileen
��������b{ azX���"��+��b�v�u�Z�����z�b� �m���� �~���+-��+��b��鮈+ji���

If you substitute "wc -l" for the "ls" command that will give you a word count per line, in other words it will count the number of file names printed into the pipeline.
---
Holland's Person, Bill
- "An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup." - US Editor and Satirist, H. L. Mencken (1880 - 1956)
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: