I need to make a script, I need to sort out 5 files names which have the most lines. This is the part that I don't know how to do. Maybe someone could help me?
ls work | wc -l
my script, but it somehow still doesn't print names of those 5 files that has most lines
mkdir work
cp /etc/*.conf .
ls work | perl -e 'print sort { length($b) <=> length($a) } <>' | head -5
tar cf work.tar.gz work