Linux

How to fix weird fonts when using Midnight Commander & PuTTY?

Some distributions of Linux use a different default screen font, resulting in strange fonts when using MC in PuTTY. The following fixes this problem. Backup /etc/sysconfig/i18n – then clear the contents of the existing file and add the following lines: LANG=”en_GB.iso885915″ SUPPORTED=”en_GB.iso885915:en_GB:en:en_US.iso885915:en_US:en” SYSFONT=”lat0-sun16″ SYSFONTACM=”iso15″ Log out and back in again, and MC will now display […]

Linux

Search and replace in vi / vim

vi search and replace: (in command mode) The following strings illustrate how to perform a search and replace in the Unix vi editor. :g/old_text/s//new_text/g Replace EOL (end of line) :g/$/s//new_string/g where $ is EOL and \t = a tab The start of line can be equally easily searched and replaced – using the carat ^ […]