Make your own free website on Tripod.com
Linux-Madurai

Some tips!
Some interesting tips and tricks to make your life with linux all the more fun.

Hot keys

Keyboard shortcuts provide a quick and easy way to get things done especially for console 'freaks'. Below u can find some(definately a small list!) Hotkey combos.

Console:
These work under the console

shift-scrolllock
memory information
ctrl-scrolllock
process listing
shift-pageup/shift-pagedown
scroll through the terminal history
alt-(f1-f12)
switch consoles, note that the left alt is for tty1 through tty12 and the right is for tty13 through tty24
Sysrq
For this to work you will need to have Magic Sysrq compiled into your kernel and cat a '1' into /proc/sys/kernel/sysrq.These can give a set of debugging info that are disabled by default.
And for those of you wondering what the Sysrq key is its usually Print-screen key.

sysrq-(0-9)
set console log level
sysrq-b
emergency reboot
sysrq-e
kill all except init (SIGTERM)
sysrq-i
kill all except init (SIGKILL)
Bash
Hot keys for this popular shell are far too many, below is a listing of a few,

TAB
attempt to complete filename or variable name
alt-@
attept to complete hostname, inorder for this to work the hostname must be listed in /etc/hosts
ctrl-d
logout, must be entered on a blank line.
ctrl-l
clear the screen
General
Work in all 'general' places

shift-insert
paste contents of copy buffer
ctrl-a
move to the beginning of a line
ctrl-e
move to the end of a line
ctrl-u
delete from start of the line to the cursor

More!

The power to locate

Locate is a useful command for searching(provided the datbase is up-to-date, it usually is).But the results can be quite too many.To just filter down the unwanted use locate as in
locate <thing to search> | egrep 'html|whatever u want'

This prints only those lines that have the particular extension.A useful idea would be to put this as a function in your .bashrc

function loc(){
  locate $1 | egrep '<the filter u want ORed>'
}

free - how much mem do i have?
Using the free command you can view how much swap and physical memory you have in your system.The syntax free [-m]/[-k]/[-b]. -m shows the amount in Megs.-k in kilobytes and -b in bytes.

Changing console fonts
The fonts in your console can also be changed using consolechars.Only psf font formats are supported though.First find the psf fonts in your system (use locate or find) and then issue the command

consolechars --font=<location of font file>

.Only fonts having their corresponding SFM(Screen Font Map) files can be displayed.You can download more Console tools and fonts from ftp://metalab.unc.edu/pub/Linux/system/keyboards/

F1 in emacs
You can view the man page of a particular topic from emacs by adding the following lines to your .emacs file and then pressing F1 when over a particular word should take you to the particular man page.Insert the following into ~/.emacs.
(global-set-key [(f1)] (lambda () (interactive) (manual-entry (current-word))))
"Imagination is more important than knowledge" -- Albert Einstein