Mailinglist Archive: opensuse (3441 mails)

< Previous Next >
[opensuse] A question on find and how to out to file
  • From: "Chuck Payne" <terrorpup@xxxxxxxxx>
  • Date: Wed, 14 Jan 2009 08:04:15 -0500
  • Message-id: <630b55a80901140504g6239dc40gebaba8cd44f33393@xxxxxxxxxxxxxx>
Hey guys,

I hope this one get answer quickly. I have a drive that almost 80%
full. I am not sure what has filled it. So I am writing a bash script
to do a quick audit of my drive.

# This is an audit log
# this is looking for logs, txt, compress and tar balls to see what is
# filling up / on all the dam boxes

textfile=audit_files_`date +%m%d%Y`.txt
sizefile=files_size_`date +%m%d%Y`.txt

find / -name *tar >> /tmp/$textfile
find / -name *gz >> /tmp/$textfile
find / -name *tgz >> /tmp/$textfile
find / -name *txt >> /tmp/$textfile
find / -name *logs >> /tmp/$textfile

for i in `cat $textfile` ; do ls -ltsha $i >> /tmp/$sizefile ; done

The problem I am having is nothing is getting wrote to my text file.
Everything I this I get a 0 size file. What am I doing wrong?

When a place gets crowded enough to require ID's, social collapse is
not far away. It is time to go elsewhere. The best thing about space
travel is that it made it possible to go elsewhere.
-- Robert Heinlein
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups