perl -e 'srand;' \ -e 'rand($.) < 1 && ($it = $_) while <>;' \ -e 'print $it' FILE