erasing terminal output on linux
I was writing a command line program which will have a status bar, much like wget. The main problem I'm facing is: how do I delete what I've already sent into stdout/stderr? I had on idea: use the backspace char '\b' and erase the output I've sent. Is that the best way? Is it the only way? Is there a better way? PS: I don't want to use anything like ncurses. Plain old C please. Thanks EDIT: Can I also go up and/or down? Example: I have 10 lines of output, I want to change the 3rd line from Doing ABC to ABC: Done . How can I do that? Also, can anyone post more details about what VT102