#!/bin/ksh ## ## SCRIPT NAME: diruse_files_all_levs_agesort_bygui ## ## Where: in $FEDIR/scripts where $FEDIR=/apps/nns_com/fea ## ############################################################################## ## PURPOSE: Lists the files 'under' a user-specified directory ## --- at all sub-directory levels --- SORTED BY AGE. ## ## A Tcl-Tk script presents a GUI that prompts for hostid ## and a directory name. ## ############################################################################## ## CALLED BY: 'spacetools' in $FEDIR/scripts, ## actually 'spacetools.chestdef' in $FEDIR/scripts. ## ############################################################################## ## METHOD OF OPERATION: ## ## This script ## 1) uses a 'find' command to call a small utility script ## for each filename. The small utility script uses a ## combination of 'ls' and 'stat' to get the 'full' ## modify-time (year, month, day, 24-time-in-hrs-mins-secs). ## ## The 'ls' command, unfortunately, gives the modify-time in two ## different formats: ## 1) without the year, when the file s less than a year old ## and ## 2) wthout the 24-hr-time, when the file is more than ## a year old. ## ## This script uses the 'stat' command to get the 'full' modify-time. ## ## But the month in the modify-time is in 3-char alpha format ## rather than numeric. Hence, the next 'awk' step. ## ## 2) The output of the 'find-ls-stat' construct is piped into ## an 'awk' script that replaces the 3-char-alpha-month by ## a numeric-month, for each file-line in the 'find' output. ## ## 3) The output of the 'awk' script is piped into a 'sort' command ## --- to sort by (year, month, day ,24-time-in-hrs-mins-secs). ## ##------------- ## Further info --- on the method of getting file-info: ## ## The Unix 'find' command is used to recursively travel through ## the sub-directories of the specified directory ## $DIRNAME ## and execute the 'ls -l' and 'stat' commands to provide a list ## - without breaks with sub-directory 'section' names ## and, instead, ## - with fully-qualified filenames. ## ## I.e. a list is produced that is suitable for (age) sorting over multiple ## directory-levels --- because every line has the same format --- ## ## In addition, it is helpful to have the full-filename in each record. ## ##--- ## ## The 'stat' command is used replace date-time info like ## ## Sep 21 14:25 ## to ## Sep 21 14:25: ## and ## Sep 21 1996 ## to ## 1996 Sep 21 ## ##--- ## ## The 'awk' is used to replace the alpha-month (like Sep) ## by a numeric month (like 9). ## ##--- ## ## Then 'sort' sorts on year#, month#, day#, 24-hour-time-stamp. ## ############################################################################## ## DATE-TIME IMPROVEMENT with 'stat': ## ## We use the SGI 'stat' command on each file to improve the display ## of (modify-)date-time for each file --- and to improve the output ## (order) of the age-sort. ## Example: ## ## stat | tail -1 | awk '{print $8 " " $5 " " $6 " " $7}' ## ## or, more sure to get the 'modify time' line, ## ## stat | grep 'modify time -' | awk '{print $8 " " $5 " " $6 " " $7}' ## ############################################################################## ## NOTE: You can see only the non-commented, executable lines of this ## script by using ## egrep -v '^ *##|^ *# ' ## or ## grep -v '^ *##' | grep -v '^ *# ' ############################################################################## ## MAINTENANCE HISTORY: ## Written by: B.Montandon O06 21Sep2000 Based on ## 'diruse_files_all_levs_sizesort_bygui' ## in $FEDIR/scripts ## and p.290 of 'Unix Power Tools' ## ## Updated by: Blaise Montandon 11apr2001 Set THISYEAR to "yyyy". ## ## Updated by: Blaise Montandon 28apr2003 Revise the preliminary-'kludge' ## method of dealing with the 2 different ## formats of modify-time from 'ls' --- ## by using the 'stat' command to get ## the full modify-time, including BOTH ## year & 24-hour-time. ## ## Updated by: Blaise Montandon 29apr2003 Replace Tk-GUI script ## 'enter_hostid_and_dir.tk' by ## 'enter_hostid_and_dir_toghelp-scroll.tk'. ## ## Updated by: Blaise Montandon 26aug2003 Load HOST_ID & DIRNAME vars from ## script args $1 & $2. If not loaded ## (i.e. = "") then use the previous ## defaults. ## ## Updated by: Blaise Montandon 02sep2003 Chg 'sort -k5 -k6 -k7 -k8 -k9' ## to 'sort -k5n -k6n -k7n -k8 -k9'. ############################################################################## if test "$FEDIR" = "" then FEDIR=/apps/nns_com/fea fi ############################################################################## ## SET query hostname and directory from script arguments 1 & 2 ## --- if not already set. ############################################################################## if test "$HOST_ID" = "" then HOST_ID="$1" fi if test "$HOST_ID" = "" then DIRNAME="$2" fi ############################################################################## ## SET LOCAL HOST NAME FOR MESSAGES & REPORTS & LOCAL-HOST-CHECKS. ############################################################################## THISHOST=`hostname` SERVER="engprd00" FEA_SERVER="engfea00" VIZ_SERVER="engvis00" ######################################################################## ## GET HOSTID and DIRECTORY NAME. ######################################################################## WINTITLE="Files(w.sizes)_for_given_Host:Dirname (ALL dir levels) -- AGE SORTED" export WINTITLE WIN_INFO="\ Enter 1) the name of an SGI (Unix) host on the site network and 2) a directory name. This utility shows all the 'ordinary file' names (NOT directory names), the FULL-FILENAMES, at *ALL LEVELS* under the specified directory --- in *AGE* sort order. --- For small to moderate sized ('shallow') directories, this report is typically generated in 3 to 30 seconds. If there are MANY sub-directories and/or files under the specified directory, i.e. if the specified directory is 'deep', IT MAY TAKE MORE THAN A MINUTE OR TWO. USE THIS UTILITY SPARINGLY ON HUGE DIRECTORIES. ------------------ 'LOCAL' PROCESSING (for speed): This utility uses a 'find' command in the form find -local -type f -exec .../file_ls_stat_info \"{}\" \\; --- with output piped to an 'awk' script and then piped to a 'sort'. The '-type f' selects 'ordinary files', rather than directories, for listing. The '-local' parameter is used to list only the files 'local to' the specified host --- NOT files in a directory mounted from a remote machine. This helps eliminate cases like following through all the subdirectories of a mounted directory like '$SERVER:/usr/people'. So FOR PROPER RESULTS (AND FOR FAST PERFORMANCE), it is necessary to SPECIFY THE HOST AT WHICH THE DIRECTORY'S DISK IS LOCALLY ATTACHED. Examples: $SERVER and $HOME $SERVER and /data//cae/$USER $THISHOST and /local/scratch/$USER $THISHOST and /local/scratch $FEA_SERVER and /local/scratch/$USER $VIZ_SERVER and /division/... Local/remote directories references: The 'ManyDirs' button of this GUI --- or use the 'df -m' command on a host --- or use the 'Show FILE-SYSTEM-SIZES @AnyHost (%-USED SORT)' drawer in the HandyTools-SpaceTools toolchest. ---------- THE OUTPUT (and its use): This utility shows the FULLY-QUALIFIED NAMES of EACH OF THE FILES under the specified directory --- in **ALL SUB-directories** of that directory --- sorted by AGE. This AGE-SORTED file information is especially helpful, when a file system is near-full, to locate VERY OLD files which might be candidates for REMOVING or COMPRESSING or ARCHIVING 'off-line'. The DISK USAGE of EACH OF THE FILES is shown --- along with its LAST-MODIFIED-DATE-TIME. That time is often the CREATE-date-and-time of the file, if the file has not been updated or moved since it was created. -------- THE GUI: Note that you can expand this window to enter-and-see the full directory name. You can do queries on multiple hosts/directories and bring the report windows side-by-side for comparison. --------------------------------------------------------------------------- This GUI is presented by the 'wrapper' script $0 This 'wrapper' script also performs the report generation --- with a find-awk-sort 'pipe' of commands, and a couple of utility scripts $FEDIR/scripts/file_ls_stat_info $FEDIR/scripts/diruse_files_all_levs_agesort_awkprog Then the 'wrapper' script shows the report." export WIN_INFO # THIS UTILITY RESTRICTS ITS ATTENTION TO FILES 'LOCAL TO' THE # SPECIFIED HOST --- for performance and to make sure it does not follow # (unintentionally) links to huge directories that are mounted from another # (remote) host --- like $SERVER:/usr/people. ## WIN_GEOM="+40+40" ## export WIN_GEOM ## WIN_COLOR="#AAAAAA" ## export WIN_COLOR ################################ ## SET DEFAULT HOST & DIR NAMES. ################################ ## HOSTS_LIST="`hostname` engfea00 engvis00 engprd00 ews###" ## export HOSTS_LIST if test "$HOST_ID" = "" then # HOST_ID="$SERVER" HOST_ID="`hostname`" fi export HOST_ID if test "$DIRNAME" = "" then # DIRNAME="$HOME" # DIRNAME="/local/scratch" DIRNAME="/local/scratch/$USER" fi export DIRNAME ######################################################################## ## START OF PROMPTING LOOP, FOR HOST:DIRECTORY-NAME. ######################################################################## ## # while true ## while : ## do ######################################################################## ## PROMPT FOR HOST:DIRECTORY-NAME. ######################################################################## # TEMP=`$FEDIR/tkGUIs/enter_hostid_and_dir.tk` TEMP=`$FEDIR/tkGUIs/enter_hostid_and_dir_toghelp-scroll.tk` eval "$TEMP" ## FOR TESTING: # echo $TEMP if test "$HOST_ID" = "" then exit fi if test "$DIRNAME" = "" then exit fi ############################################################ ## IF THE DIRECTORY SPECIFIED IS '/' or '/usr' or '/usr/people', ## POP A MSG AND EXIT. ############################################################ FONT_XCONFIRM="-*-courier-bold-r-normal-*-14-*-*-*-*-*-*-*" if test \( "$DIRNAME" = "/" -o "$DIRNAME" = "/usr" -o \ "$DIRNAME" = "/usr/" -o "$DIRNAME" = "/usr/people" -o \ "$DIRNAME" = "/usr/people/" -o "$DIRNAME" = "/usrpeople" \) then JUNK=`xconfirm -c -header "Files-by-AGE,ALL-Levels: EXITING" \ -B DISMISS \ -font "$FONT_XCONFIRM" \ -t "The directory specified was " \ -t "" \ -t " $HOST_ID : $DIRNAME" \ -t "" \ -t "-- one of the 'BIG-BAD' directories: '/' or '/usr' or '/usr/people'." \ -t "" \ -t "The user 'home' directories are under these directories." \ -t "" \ -t "There are MANY THOUSANDS of files there --- whose ages would have" \ -t "to be properly formatted to answer your query. EXITING ..." \ -t "" \ -t "Please change your query to a more specific directory, like" \ -t " /var /local /tmp /etc /bin /sbin /lib /lib32 /lib64" \ -t " /opt /Desktop /dev --- OR a specific '/usr' sub-directory, like" \ -t " /usr/adm /usr/var /usr/tmp /usr/spool /usr/sysadm" \ -t " /usr/bin /usr/sbin /usr/bsd /usr/etc /usr/webdocs" \ -t " /usr/lib /usr/lib32 /usr/lib64 /usr/gfx /usr/include" \ -t " /usr/people/$USER etc." \ -t "If the root directory allocation on the local machine is nearly full," \ -t "per 'df' command, the most likely 'culprits' are '/var' or '/local'." \ -icon warning` exit fi ############################################################ ## WARN THE USER ABOUT HUGE DIRECTORIES. GIVE THEM A CANCEL ## A CANCEL OPTION. ############################################################ GO_NOGO=`xconfirm -c \ -header "Files-by-AGE,ALL-Levels: BIG_DIRECTORY_warning" \ -b CANCEL -B GO \ -font "$FONT_XCONFIRM" \ -t "*IF* the directory specified --- namely " \ -t " $HOST_ID : $DIRNAME" \ -t "--- is a directory that contains MANY THOUSANDS of sub-directories" \ -t "and/or files, it could take a long time (many minutes)" \ -t "to generate the LIST-FILES-BY-AGE (ALL-LEVELS) report." \ -t "" \ -t "One option is to try a lower-level directory --- one that is likely" \ -t "to have MANY HUNDREDS of files --- rather than MANY THOUSANDS." \ -t "" \ -t "Another (fast-response) option, to see files-listed-based-on-age," \ -t "is to use the 'spacetools' option/drawer ---" \ -t "'Show FILES for AGE,SIZE MIN,MAX 4aDir@AnyHost ('local' files)' ---" \ -t "and specify a MIN-MAX limit on the AGES, or SIZES, of files." \ -t "By limiting the number of files to list, the MIN,MAX inquiry" \ -t "can proceed rather quickly. Also, the MIN,MAX query is faster" \ -t "because it does not sort by age --- rather it selects by AGE-RANGE." \ -t "" \ -t "If THIS query takes a long time, you can use a command like 'ps -fu $USER'" \ -t "on the host -- $HOST_ID -- to check that the query is running. And" \ -t "you can 'kill' some 'find' and 'agesort' processes. Cancel or Go?" \ -icon warning` # -font $CONFIRM_FONT \ if test "$GO_NOGO" = "CANCEL" then exit fi ##################################################################### ## CHECK THAT THE HOST_ID EXISTS, if not THISHOST. ##################################################################### ## FOR TESTING: # set -x if test ! "$HOST_ID" = "$THISHOST" then HOSTCHECK=`rsh $HOST_ID cd 2>&1 | grep 'Unknown host'` if test ! "$HOSTCHECK" = "" then CONFIRM_TEXT="\ Specified Host: $HOST_ID is Unknown. " export CONFIRM_TEXT CONFIRM_GEOM="+080+080" CONFIRM_MINSIZE="350 150" CONFIRM_TITLE="$WINTITLE" export CONFIRM_TITLE CONFIRM_MINSIZE CONFIRM_GEOM CONFIRM_COLOR="#3DADFF" export CONFIRM_COLOR CONFIRM_FONT="-adobe-helvetica-bold-r-normal--*-100-*-*-p-*-*-*" export CONFIRM_FONT JUNK=`$FEDIR/tkGUIs/confirm.tk DISMISS` & exit ## continue fi ## END OF if test ! "$HOSTCHECK" = "" fi ## END OF if test ! "$HOST_ID" = "$THISHOST" ################################################################### ## CHECK THAT THE DIRNAME IS ACCESSIBLE/EXISTS. ## -- on $HOST_ID (do local or remote check). ##################################################################### ## For a slightly different technique of handling 'stdout & stderr' ## (with 2>&1), see $FEDIR/scripts/find_big_or_old_files4dir_bygui ##################################################################### ## FOR TESTING: # set -x if test "$HOST_ID" = "$THISHOST" then DIRCHECK=`ls -d $DIRNAME 2> /dev/null` else . $FEDIR/scripts/mak_rhosts DIRCHECK=`rsh $HOST_ID ls -d $DIRNAME 2> /dev/null` fi if test "$DIRCHECK" = "" then CONFIRM_TEXT="\ Specified Directory: $DIRNAME Not found or does not exist, according to $HOST_ID. Exiting. " export CONFIRM_TEXT CONFIRM_GEOM="+080+080" CONFIRM_MINSIZE="350 150" CONFIRM_TITLE="$WINTITLE" export CONFIRM_TITLE CONFIRM_MINSIZE CONFIRM_GEOM CONFIRM_COLOR="#3DADFF" export CONFIRM_COLOR CONFIRM_FONT="-adobe-helvetica-bold-r-normal--*-100-*-*-p-*-*-*" export CONFIRM_FONT JUNK=`$FEDIR/tkGUIs/confirm.tk DISMISS` & exit ## continue fi ## END OF if test "$DIRCHECK" = "" ########################################################### ## EXIT IF USER SPECIFIES '/' for the directory. ########################################################## ## if test "$DIRNAME" = "/" ## then ## echo " ## Try a lower level directory than the root directory (/). ## ## *** Press Enter to continue." ## read NNS_JUNK ## ## continue ## # exit ## fi ########################################################## ######################################################################## ## If the directory $DIRNAME is NSF-mounted on host $HOST_ID, ## show a message on possible performance improvement in doing the ## query on a remote host-server. ######################################################################## # THISHOST=`hostname` ## WAS SET ABOVE. if test "$HOST_ID" = "$THISHOST" then NFSCHECK=`stat $DIRNAME | grep 'st_fstype: nfs'` else . $FEDIR/scripts/mak_rhosts NFSCHECK=`rsh $HOST_ID stat $DIRNAME | grep 'st_fstype: nfs'` fi if test "$NFSCHECK" != "" then CONFIRM_TEXT="\ The directory name that you specified $DIRNAME is NFS-mounted to the host you specified, $HOST_ID, i.e. the directory is remote from the specified host, NOT 'local to' it. USE A HOST FOR WHICH THE DIRECTORY IS IN A 'LOCAL' FILE SYSTEM. I.E. USE A HOST THAT IS SERVING-OUT THE DIRECTORY. " export CONFIRM_TEXT CONFIRM_GEOM="+080+080" CONFIRM_MINSIZE="550 250" CONFIRM_TITLE="$WINTITLE" export CONFIRM_TITLE CONFIRM_MINSIZE CONFIRM_GEOM CONFIRM_COLOR="#3DADFF" export CONFIRM_COLOR ## GOOD FIXED-WIDTH CANDIDATES (for env var CONFIRM_FONT): # set TEXT_FONT "-adobe-courier-bold-r-normal--*-120-*-*-m-92-*-*" # set TEXT_FONT "-adobe-courier-bold-r-normal--*-100-*-*-m-90-*-*" # set TEXT_FONT "-adobe-courier-medium-r-normal--*-100-*-*-m-90-*-*" # set TEXT_FONT "-misc-fixed-bold-r-normal--*-120-*-*-c-70-*-*" # set TEXT_FONT "-misc-fixed-bold-r-normal--*-120-*-*-c-80-*-*" # set TEXT_FONT "-misc-fixed-bold-r-normal--*-120-*-*-c-90-*-*" # set TEXT_FONT "-b&h-lucidatypewriter-bold-r-normal-sans-*-140-*-*-m-80-*-*" # set TEXT_FONT "-schumacher-clean-bold-r-normal--*-130-*-*-c-80-*-*" ## GOOD VARIABLE-WIDTH CANDIDATES (for env var CONFIRM_FONT): # set TEXT_FONT "-adobe-helvetica-bold-r-normal--*-100-*-*-p-82-*-*" # set TEXT_FONT "-adobe-times-bold-r-normal--*-100-*-*-p-76-*-*" # set TEXT_FONT "-adobe-palatino-bold-r-normal--*-100-*-*-p-81-*-*" # set TEXT_FONT "-adobe-new century schoolbook-bold-r-normal--*-100-*-*-p-87-*-*" # set TEXT_FONT "-adobe-utopia-regular-r-normal--*-100-*-*-p-75-*-*" # set TEXT_FONT "-adobe-utopia-medium-r-normal--*-100-*-*-p-75-*-*" CONFIRM_FONT="-adobe-helvetica-bold-r-normal--*-100-*-*-p-*-*-*" export CONFIRM_FONT JUNK=`$FEDIR/tkGUIs/confirm.tk DISMISS` & exit fi ## END OF if test "$NFSCHECK" != "" ##################################################################### ## Set a filename for report output, in $OUTLIST. ##################################################################### . $FEDIR/scripts/set_localoutlist rm -f $OUTLIST ########################################################################## ## SET REPORT HEADING. ########################################################################## echo " ................... `date '+%Y %b %d %a %T%p'` ............................ FILES IN *ALL* THE SUB-DIRECTORIES UNDER DIRECTORY ${HOST_ID}:$DIRNAME ********************************************* SORTED BY *AGE* --- *OLDEST* FILES AT THE TOP, ********************************************* WITH DISK USAGE SHOWN. AGE-SORT ******************* Disk usage Last-Modified (MegaBytes) Permissions Owner Group Year-Mo-Dy-hh:mm:ss Filename -------------- ----------- -------- -------- ------------------- ---------------------- GigMeg.KilByt | | | |" > $OUTLIST ##################################################################### ## PERFORM THE QUERY -- on the specified host. ## Sort by year/month/day/time. ##################################################################### ## We could put a command like ## stat -m | awk '{print $(NF-1)}' ## together with ## ls -l ## to fill in the year, instead of using THISYEAR="yyyy". ##################################################################### # THISHOST=`hostname` ## WAS SET ABOVE. if test "$HOST_ID" = "$THISHOST" then ## FOR TESTING: # set -x find $DIRNAME -local -type f \ -exec $FEDIR/scripts/file_ls_stat_info "{}" \; | \ awk -f $FEDIR/scripts/diruse_files_all_levs_agesort_awkprog | \ sort -k5n -k6n -k7n -k8 -k9 >> $OUTLIST # awk -f $FEDIR/scripts/diruse_files_all_levs_agesort_awkprog_NEW | \ ## FOR TESTING: # set - else . $FEDIR/scripts/mak_rhosts ## FOR TESTING: # set -x # rsh $HOST_ID "find $DIRNAME -local -type f \ # -exec $FEDIR/scripts/file_ls_stat_info "{}" \;" | \ # awk -f $FEDIR/scripts/diruse_files_all_levs_agesort_awkprog | \ # sort -k5 -k6 -k7 -k8 -k9 >> $OUTLIST ## The find-awk-sort pipe of commands is quoted-together, to get them ## to all execute on the remote host, which is often a powerful server. rsh $HOST_ID "find $DIRNAME -local -type f \ -exec $FEDIR/scripts/file_ls_stat_info "{}" \; | \ awk -f $FEDIR/scripts/diruse_files_all_levs_agesort_awkprog | \ sort -k5n -k6n -k7n -k8 -k9" >> $OUTLIST # awk -f $FEDIR/scripts/diruse_files_all_levs_agesort_awkprog_NEW | \ ## FOR TESTING: # set - fi ## END OF if test "$HOST_ID" = "$THISHOST" ######################################################################## ## Add TRAILER to report. ######################################################################## echo "\ | | | | GigMeg.KilByt -------------- ----------- -------- -------- ------------------- ---------------------- (MegaBytes) Permissions Owner Group Year-Mo-Dy-hh:mm:ss Filename Disk usage Last-Modified ******************* AGE-SORT ................... `date '+%Y %b %d %a %T%p'` ............................ The AGE-SORTED output above was generated by the script $0 That script was initiated on $THISHOST. That script ran the 'find' command, indicated below, on host $HOST_ID . The age-sort is accomplished by sorting by data columns 5, 6, 7, and 8 --- year, numeric-month, numeric-day, and time-of-day (hrs:mins:secs). ----------------- PROCESSING METHOD: A 'pipe' of several commands (find, ls, stat, awk, sort) was used, of the form: find -local -type f \\ -exec $FEDIR/scripts/file_ls_stat_info \"{}\" \\; | \\ awk -f | sort -k5 -k6 -k7 -k8 -k9 where {} represents a filename. The Unix 'find' command was used to recursively travel through the sub-directories of the specified directory $DIRNAME and execute the 'ls -l' and 'stat' commands, via a small script called 'file_ls_stat_info'. The script 'file_ls_stat_info' uses a combination of the 'ls -l' and 'stat' commands to get file properties of each file. The properties include - file size, in bytes - permissions - user-login-name of the file owner - the name of the owning group - last-modify-time (year, month, day, 24-hour-time-in-hrs-mins-secs) ------------ FEATURE NOTE: This 'find'-'ls'-'stat'-'awk' technique provides a filenames-and-properties list - without breaks at sub-directory changes --- at which sub-directory 'section' names are shown (This is what would happen if 'ls -lR' were used instead of the 'find ... -exec ...ls... {}' command.) - with each file-info line having the same format (The lines would have two different modify-date formats, if 'ls -l' were used, instead of a combination of 'ls -l' and 'stat'.) - with the month in 2-character-numeric format, instead of 3-character-text format. (The lines would have 3-character-months, if a translation technique like the 'awk' script were not used.) I.e. 'find'-'ls'-'stat'-'awk' are used to produce a files-list that is suitable for sorting --- in particular, suitable for sorting by AGE. ---- And, instead of 'relative' filenames, this 'find' technique provides a list - with FULLY-QUALIFIED filenames. The list shows 'full' filenames for unambiguous identification, without having to scroll back in the listing. This also has the advantage of allowing easy pasting of full-filenames into other utilities and commands. --------- RUN TIME: This inquiry runs WITHIN 15 SECONDS for directories (even remote directories) that contain a total of a FEW HUNDRED files. But ... BE AWARE: If the specified directory contains MANY THOUSANDS of files at one or more of its sub-directory levels, the inquiry may run for MINUTES. (The 'find' command considers EVERY file at ALL LEVELS under the specified directory. And .. For each directory found by the 'find' command, a combination of several commands --- 'ls', 'stat', and 'awk-script' --- are performed. Plus, there is awk-data-formatting and a 'sort' performed after the output is formatted appropriately. So, naturally, an inquiry involving MANY THOUSANDS of files will require at little wait time of the inquirer. But to do the AGE-SORT inquiry manually with Unix commands is not really feasible for a directory with a 'deep' structure.) ---------------------- IMPLEMENTATION METHODS: This utility script can be accessed via a drawer in a 'SpaceTools' toolchest, via the 'spacetools' command --- a drawer name like 'Show FILE-SIZES 4aDir@AnyHost (ALL levels, AGE-SORT)'. The full path via site toolchests-drawers is SGI Toolchest -> HandyTools -> SpaceTools -> Show FILE-SIZES 4aDir@AnyHost (ALL levels, AGE-SORT) You can also implement the script (or 'spacetools' or 'handytools' toolchest-scripts) as - a command alias, via your .profile file; - a desktop icon, via the 'Find, File QuickFind' tool drawers; - a drawer in the SGI toolchest, via your .auxchestrc file. ........................................................................ " >> $OUTLIST ##################################################################### ## SHOW THE REPORT, with option to print. ##################################################################### $FEDIR/scripts/shofil $OUTLIST ## done ######################################################################## ## END OF prompting loop, for directory name. ######################################################################## ## RETURN TO DIRECTORY PROMPT. ########################################################################