#!/bin/bash for X in `find dir | grep -E '\.log$'`;do cat $X | sort > $X done