First you would need your file list sorted by file size
#!/bin/ksh
SearchPath=/whereever0
LowerSizeFilePath=/whereever1
UpperSizeFilePath=/whereever2
#
cd $SearchPath
ls -e | egrep -v "/$|->" | cut -c31-41,63- | sort -n -k 1n,10 | cut -c12- > /tmp/filelist~
#^ ^ ^ ^ ^
#| | | | + get file
#| | | +-- Sort file list by file size
#| | +-- Get only file size and file name
#| +-- Get off the list soft links and directories entries
#+-- list extended $CWD
#
#You can send the list to a temp file with "> /tmp/filelist~"
#
#You need to know the number of file with
FileCount=`cat /tmp/filelist~ | wc -l`
HeadSize=`expr $FileCount / 2`
TailSize=`expr $FileCount - $HeadSize`
#
mv `head -$HeadSize /tmp/filelist~` $LowerSizeFilePath
mv `tail -$TailSize /tmp/filelist~` $UpperSizeFilePath
rm /tmp/filelist~
|