#!/bin/ksh # # Script for finding big files similar to bigfiles # admin@wickedmind.com # 08/09/99 # # @(#) $Revision: 2.0 $ stty -imaxbel # Shell script to identify any files that are too large: # # This file should be located in: /usr/local/bin # - this directory is include in the $PATH of all users # # Set up the terminal: if [ "$TERM" = "" ] then eval ` tset -s -Q -m ':?hp' ` else eval ` tset -s -Q ` fi LARGE_FILE_DIR=/lf_history; export LARGE_FILE_DIR DATE=$(date +%y%m%d); export DATE cd / echo "All files larger than 1M ==>" >> ${LARGE_FILE_DIR}/large_files_${DATE}.txt ls -Rlat | awk '( $5 > 10000000 || $5 < 0 ) && ($1 != "total" && $1 > " ")' > $LARGE_FILE_DIR/large_files_${DATE}.txt echo "All CORE files which should be removed ==>" >> $LARGE_FILE_DIR/dump_files_${DATE}.txt ls -Rlat | awk ' $9 == "CORE" ' > $LARGE_FILE_DIR/dump_files_${DATE}.txt