#!/bin/bash
for i in `seq 10 1`;do
echo -en "\r\x1B[2K";
echo -n "$i";
sleep 2;
done;
\x1b[2K
is what’s known as an ANSI terminal control sequence.
\x1b
is the ASCII for ESCAPE (literally the ESC key on your keyboard). [2K
is the command “erase the current line”.