October 22, 2010

Cat all files in directory

$ cat catall 
for i in $(ls -rt1 `find -type f`);
do
# type file name in red color
echo -e "\033[31;1m$i\033[0m"
cat $i;
done;


This script won't work for files with whitespaces within their names