Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am considering adding the following echo command to /etc/profile

echo -e ‘\033[9;0]\033[14;0]’

The system in question does not have setterm command available and is just running text console.

Are there any problems with doing this the way I plan to?

share|improve this question
up vote 2 down vote accepted

/etc/profile is read by several Bourne-like shells. echo -e is not standard, so there might be some shells on your system that don't recognize it. You should use printf instead.

printf '\033[9;0]\033[14;0]'

(which in addition, won't add that spurious newline character).

Some tools may start non-interactive login shells (like with bash --login) where you may not want that to happen. You could add extra checks like:

case $TERM$- in
  (linux*i*) printf '\033[9;0]\033[14;0]' > /dev/tty

To check that you're in a Linux virtual console and that it is an interactive shell. Outputting to the controlling terminal in case stdout has been redirected.

share|improve this answer
Thanks. This is what I was looking for. – Plazgoth Nov 29 '12 at 10:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.