You do not change the file itself. Using tail , you simply read the file and print its parts to stdout (terminal), you must redirect this output to a temporary file and then overwrite the original file with a temporary one.
#!/usr/bin/env bash for f in *.data; do tail -n +2 "$f" > "${f}".tmp && mv "${f}".tmp "$f" echo "Processing $f" done
Also, it is not clear what you would like to achieve with the echo command. Why are you using a pipe ( | )?
sed will give you an easier way to achieve this. See devnull answer.
source share