To display name and size of the files in the current directory and sort the list based on the size of the file, you can use the below awk command.
ls -shF | awk '{printf “%-30s %s\n”,$2,$1}' | sort -k2,2
You can use a shell script to add extensions to the above command. Other commands...