xterm – select font name and size from command line and set it as default

2010-05-05 271 words 2 mins read

I have been very busy last week and specially yesterday with 20 hours of continueous work, but managed to get this working :).

When you right click on Xterm with Ctrl pressed, there pops up a menu for selecting the size of the font. I have always wondered how to set this as default font and/or use this from the command line. So I searched my old homedir and looked for few of the docs that I had to get the information. Here is what I found.

First we need to find the fonts that are installed to use them, so here is the command to do that:

Hack1004$xlsfonts |more


Now you can select the font that you want to use and then we are ready to go.

For selecting the font from the command line invocation of the xterm, the fontname can be specified with -fn and font size with -fs.


xterm -fn -adobe-courier-bold-o-normal–14-100-100-100-m-90-iso8859-1

xterm -fn 8×16

Now for the same to be set as default. The defaults for the xterm can be set in the terminal settings that are read by the xrdb program. These can go in the ~/.Xdefaults . You can see the current one in use by issuing the command:


and then set them using the following entries in .Xdefaults

xtermsaveLines: 10000
scrollBar: true
xtermrightScrollBar: true
jumpScroll: true
xtermcursorColor: red
colorBD: darkblue
xtermcolorBDMode: true
highlightColor: yellow
xtermactiveIcon: false
awaitInput: true
xtermscrollTtyOutput: false
scrollKey: true

xtermBackground: DarkSlateBlue
Foreground: black

and run

xrdb -merge ~/.Xdefaults

BTW, you can also change the font size using the shift plus/minus.


Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it