Head all files in directory Mon 06 June 2016 in Bash, Command Line, Linux, Programming #bash #head #loop Needed to head all files in a directory. \#!/usr/bin/env bash DEST=/tmp for i in /files/to/head/\* do head -10 "\${i}" > \${DEST}/\$(basename \$i) done