How to list installed font on Linux/X
Simple command used to list font installed in your linux box.
This had been used on Ubuntu 10.10
-> xlsfonts
My terminal settings for xterm
This is how to set my settings for a nice Xterm.
Set .Xdefaults file to :
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48
xterm*ScrollBar: on
xterm*SaveLines: 32000
xterm*background: black
xterm*foreground: white
xterm*font: -misc-fixed-medium-r-normal–0-0-75-75-c-0-iso8859-1
Then reload X default using : xrdb -merge .Xdefaults
Bash fun, the substring removal
So while trying to do some for loops I needed to be able to use a variable, but I needed to remove this nasty \n at it’s end before using it.
Here is the data I was using in the for loop (in file testfile)
host1
host2
host3
Here is the for loop
for t in `cat testfile`; do echo $t;scp sourcefile $t:;done
Simple, but the issue is that the scp wont work because of the \n character at the end of the $t variable. An easy workaround is to use the Bash sub-string deletion. So here is what is needed.
for t in `cat testfile`; do echo ${t%\\n}; scp sourcefile ${t%\\n}:;done
Funny!
If you want more information you can refer to “The linux documentation project“
