Phil for Humanity Phil for Humanity
A Guide for the Survival of Humankind and Helping the World, Society, and Yourself.

UNIX Warning Message: could not open /dev/kbd

Don't you hate when you get a warning message in UNIX that you don't understand?

Well, I do. This week I kept getting this "could not open /dev/kbd to get keyboard type US keyboard assumed" warning message from several different UNIX scripts and programs, and it was driving me crazy.

Here is an example of what I was getting:

$ dos2unix file.txt > file2.txt
could not open /dev/kbd to get keyboard type US keyboard assumed
could not get keyboard type US keyboard assumed

After considerable investigation, I figured out that this UNIX warning message means that the UNIX server that I was connected to either had no keyboard attached to it or that the keyboard was not defined correctly.

The ideal solution is to attach or configure a keyboard to the server in question, but I did not have access to the server room. So I discovered (thanks to Google) that there is an undocumented argument to suppress certain types of warnings, so that you do not have to see this UNIX warning message any more.

For example, this produces no warning messages:

$ dos2unix -437 file.txt > file2.txt

Of course, this argument can suppress additional useful warning messages, and you can also re-direct stderr to /dev/null too.

I hope this helps someone.

by Phil for Humanity
on 03/09/2007

Related Articles
 » UNIX Support: Analyzing and Improving System Loads
 » ClearCase Support: Automate Checking of ClearCase Server Log Files
 » ClearCase Support: Checked Out But Removed Error