User Friendly Linux

Gw

Configuring a User-Friendly Shell (aka using bash instead of ksh)

Most of the time, we will be working in a terminal. Therefore, it is important that the shell you are using is user-friendly. For example, it is quite useful if pressing the Delete key actually deletes a character. For many users, bash is easier to use then the default shell on our Linux machines: ksh (Korn Shell). You can find out what shell you are using by typing:

ps $$

You can also recognize the shell by its prompt: the usual prompt of ksh is a plain $. Bash usually shows the current user, directory, followed by a >. You can change the shell to bash by just entering the command bash. If you want to change your shell to bash forever, then add the line bash the end of the file ~/.profile (~ refers to your home directory). From now, we will assume that you are using bash.

If you Bash prompt is not user:currentdir>, then you can configure bash to use this prompt by adding the line

PS1="\\u:\\w> "
to your ~/.bashrc file.

Make GNU Emacs User Friendly

For some students this will be their first experience with a GNU/Linux system. If you are looking for a good editor, then GNU Emacs is a good choice, but of course you can use whatever editor you want. Unfortunately, GNU Emacs has some rough edges in its default configuration. In this section we will explain how to configure GNU Emacs to make it more user friendly

First, many people are used to Ctrl-cxv and using Shift for selection. The CUA mode configures Emacs to use these key bindings. Download the CUA Mode (mirror) to a directory, for example myemacs or .myemacs (hidden).

Next, edit the file ~/.emacs to activate the CUA mode. Add the following lines the end of this file:

(add-to-list 'load-path "~/myemacs")
(require 'cua)
(CUA-mode t)

Now you can start GNU Emacs:

$ emacs

You can specify files that you want to open on the command-line, and you open files via the menu. Check if your Ctrl-cxv works and cry for help if it does not.

Next, you might want to change the default font of GNU Emacs. You can do that by saving this file to your home directory.

Editing XML: nxml-mode

The nxml-mode is an excellent extension of GNU Emacs for editing XML files. It supports well-formed checking, validation, indenting, and code completion.

You can download it here:

Quick installation instructions: add this to your the file ~/.emacs

(load-file "~/nxml-mode-datetime/rng-auto.el")

(add-to-list 'auto-mode-alist '("\\.xml\\'" . nxml-mode))
(add-to-list 'auto-mode-alist '("\\.html\\'" . nxml-mode))
(add-to-list 'auto-mode-alist '("\\.xsd\\'" . nxml-mode))
(add-to-list 'auto-mode-alist '("\\.rng\\'" . nxml-mode))
(add-to-list 'auto-mode-alist '("\\.xsl\\'" . nxml-mode))
(add-to-list 'auto-mode-alist '("\\.xslt\\'" . nxml-mode))