<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
 <TITLE>Linux Frequently Asked Questions with Answers: How do I do this or find out that ... ? </TITLE>
 <LINK HREF="Linux-FAQ-8.html" REL=next>
 <LINK HREF="Linux-FAQ-6.html" REL=previous>
 <LINK HREF="Linux-FAQ.html#toc7" REL=contents>
</HEAD>
<BODY>
<A HREF="Linux-FAQ-8.html"><IMG SRC="next.gif" ALT="Next"></A>
<A HREF="Linux-FAQ-6.html"><IMG SRC="prev.gif" ALT="Previous"></A>
<A HREF="Linux-FAQ.html#toc7"><IMG SRC="toc.gif" ALT="Contents"></A>
<HR>
<H2><A NAME="How do I do this or find out that ... ?"></A> <A NAME="s7">7. How do I do this or find out that ... ? </A></H2>

<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How can I get scrollback in text mode?"></A> <A NAME="ss7.1">7.1 How can I get scrollback in text mode? </A>
</H2>

<P>With the default US keymap, you can use Shift with the PageUp and
PageDown keys.  (The gray ones, not the ones on the numeric keypad.)
With other keymaps, look in <CODE>/usr/lib/keytables</CODE>.  You can
remap the ScrollUp and ScrollDown keys to be whatever you like.  For
example, to remap them to the keys on an 84-key, AT keyboard.
<P>The "screen" program, 
<A HREF="http://vector.co.jp/vpack/browse/person/an010455.html">http://vector.co.jp/vpack/browse/person/an010455.html</A>
provides a searchable scrollback buffer and the
ability to take ``snapshots'' of text-mode screens.
<P>You can't increase the amount of scrollback, because it is implemented
using the video memory to store the scrollback text.  You may be
able to get more scrollback in each virtual console by reducing the
total number of VC's.  See <CODE>linux/tty.h</CODE>.
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How do I switch virtual consoles?  How do I enable them?"></A> <A NAME="ss7.2">7.2 How do I switch virtual consoles?  How do I enable them? </A>
</H2>

<P>In text mode, press Left Alt-F1 to Alt-F12 to select the consoles
<CODE>tty1</CODE> to <CODE>tty12</CODE>; Right Alt-F1 gives <CODE>tty13</CODE> and
so on.  To switch out of X Windows you must press Ctrl-Alt-F1, etc;
Alt-F5 or whatever will switch back.
<P>If you want to use a VC for ordinary login, it must be listed in
<CODE>/etc/inittab</CODE>, which controls which terminals and virtual
consoles have login prompts.  The X Window System needs at least one
free VC in order to start.
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How do I set the time zone?"></A> <A NAME="ss7.3">7.3 How do I set the time zone? </A>
</H2>

<P>Change directory to <CODE>/usr/lib/zoneinfo/</CODE>.  Get the time zone
package if you don't have this directory.  The source is available as 
<A HREF="ftp://sunsite.unc.edu/pub/Linux/system/admin/time/timesrc-1.2.tar.gz">sunsite.unc.edu/pub/Linux/system/admin/time/timesrc-1.2.tar.gz</A>.
<P>Then make a symbolic link named <CODE>localtime</CODE> pointing to one of
the files in this directory (or a subdirectory), and one called
<CODE>posixrules</CODE> pointing to <CODE>localtime</CODE>.  For example:
<PRE>
   ln -sf US/Mountain localtime
   ln -sf localtime posixrules
</PRE>

This change will take effect immediately--try <CODE>date(1)</CODE>.
<P>The manual page for tzset describes setting the time zone.  Some
programs recognize the TZ environment variable, but this is not
POSIX-correct.
<P>You should also make sure that your Linux kernel clock is set to the
correct <CODE>GMT</CODE> time--type <CODE>date -u</CODE> and check that the
correct UTC time is displayed.  (``
<A HREF="Linux-FAQ-6.html#My clock is very wrong.">My clock is very wrong.</A>
'')
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="What version of Linux and what machine name am I using?"></A> <A NAME="ss7.4">7.4 What version of Linux and what machine name am I using? </A>
</H2>

<P>Type:
<PRE>
uname -a
</PRE>
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How can I enable or disable core dumps?"></A> <A NAME="ss7.5">7.5 How can I enable or disable core dumps? </A>
</H2>

<P>By using the <CODE>ulimit</CODE> command in <CODE>bash</CODE>, the
<CODE>limit</CODE>
command in <CODE>tcsh</CODE>, or the <CODE>rlimit</CODE> command in
<CODE>ksh</CODE>.  See the appropriate manual page for details.
<P>This setting affects all programs run from the shell (directly or
indirectly), not the whole system.
<P>If you wish to enable or disable core dumping for all processes by
default, you can change the default setting in
<CODE>linux/sched.h</CODE>--see the definition of
<CODE>INIT_TASK</CODE>, and look also in <CODE>linux/resource.h</CODE>.
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How do I upgrade/recompile my kernel?"></A> <A NAME="ss7.6">7.6 How do I upgrade/recompile my kernel? </A>
</H2>

<P>See the Kernel HOWTO or the README files which come with the kernel
release on ftp.cs.helsinki.fi, in <CODE>/pub/Software/Linux/Kernel/</CODE>
and mirrors. (See ``
<A HREF="Linux-FAQ-2.html#Where can I get Linux material by FTP?">Where can I get Linux material by FTP?</A>
'') You may already have a version of the kernel source code
installed on your system, but if it is part of a standard distribution
it is likely to be somewhat out of date (this is not a problem if you
only want a custom configured kernel, but it probably is if you need
to upgrade.)
<P>With newer kernels you can (and should) make all of the following
targets.  Don't forget that you can specify multiple targets with one
command.
<PRE>
make clean dep install modules modules_install
</PRE>
<P>Also remember to update the module dependencies.
<PRE>
depmod -a
</PRE>
<P>Remember that to make the new kernel boot you must run LILO after copying
the kernel into your root partition--the Makefile in recent kernels has
a special zlilo target for this; try:
<PRE>
make zlilo
</PRE>

Kernel version numbers with an odd minor version (ie, 1.1.x, 1.3.x)
are the testing releases; stable production kernels have even minor
versions (1.0.x, 1.2.x).  If you want to try the testing kernels you
should probably subscribe to the linux-kernel mailing list.  (See ``
<A HREF="Linux-FAQ-2.html#What mailing lists are there?">What mailing lists are there?</A>
.'')
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="Can I have more than 3 serial ports by sharing interrupts?"></A> <A NAME="ss7.7">7.7 Can I have more than 3 serial ports by sharing interrupts? </A>
</H2>

<P>Yes, but you won't be able to use simultaneously two ordinary ports which
share an interrupt (without some trickery).  This is a limitation of the
ISA Bus architecture.
<P>See the Serial HOWTO for information about possible solutions and
workarounds for this problem.
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How do I make a bootable floppy?"></A> <A NAME="ss7.8">7.8 How do I make a bootable floppy? </A>
</H2>

<P>Make a file system on it with bin, etc, lib and dev
directories--everything you need.  Install a kernel on it and arrange
to have LILO boot it from the floppy (see the LILO documentation, in
lilo.u.*.ps).
<P>If you build the kernel (or tell LILO to tell the kernel) to have a
RAM disk the same size as the floppy the RAM disk will be loaded at
boot time and mounted as root in place of the floppy.
<P>See the Bootdisk HOWTO.
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How do I remap my keyboard to UK, French, etc.?"></A> <A NAME="ss7.9">7.9 How do I remap my keyboard to UK, French, etc.? </A>
</H2>

<P>For recent kernels, get /pub/Linux/system/Keyboards/kbd-0.90.tar.gz from
sunsite.unc.edu.  Make sure you get the appropriate version; you have to
use the right keyboard mapping package for your kernel version.
<P>For older kernels you have to edit the top-level kernel Makefile, in
/usr/src/linux.
<P>You may find more helpful information in The Linux Keyboard and
Console HOWTO, by Andries Brouwer, at 
<A HREF="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/">sunsite.unc.edu/pub/Linux/docs/HOWTO</A>.
<P>
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How do I get NUM LOCK to default to on?"></A> <A NAME="ss7.10">7.10 How do I get NUM LOCK to default to on? </A>
</H2>

<P>Use the setleds program, for example (in /etc/rc.local or one of the
/etc/rc.d/* files):
<PRE>
for t in 1 2 3 4 5 6 7 8
do
    setleds +num &lt; /dev/tty$t > /dev/null
done
</PRE>

Setleds is part of the kbd package (``
<A HREF="#How do I remap my keyboard to UK, French, etc.?">How do I remap my keyboard to UK, French, etc.?</A>
'').
<P>Alternatively, patch your kernel.  You need to arrange for
KBD_DEFLEDS to be defined to (1 &lt;&lt; VC_NUMLOCK)
when compiling drivers/char/keyboard.c.
<P>-------------------------------------------------------------------------------
<P>
<H2><A NAME="How do I set (or reset) my initial terminal colors?"></A> <A NAME="ss7.11">7.11 How do I set (or reset) my initial terminal colors?</A>
</H2>

<P>The following shell script should work for VGA consoles:
<PRE>
for n in 1 2 4 5 6 7 8; do 
        setterm -fore yellow -bold on -back blue -store > /dev/tty$n
        done
</PRE>

Substitute your favorite colors, and use /dev/ttyS$n for serial
terminals.  
<P>To make sure they are reset when people log out (if they've been
changed):
<P>Replace the references to ``getty'' (or ``mingetty'' or ``uugetty'' or
whatever) in <CODE>/etc/inittab</CODE> with references to
``<CODE>/sbin/mygetty</CODE>.''
<PRE>
#!/bin/sh
setterm -fore yellow -bold on -back blue -store > $1
exec /sbin/mingetty $@
</PRE>
<P>[Jim Dennis]
-------------------------------------------------------------------------------
<P>
<H2><A NAME="How can I have more than 128Mb of swap?"></A> <A NAME="ss7.12">7.12 How can I have more than 128Mb of swap? </A>
</H2>

<P>Use several swap partitions or swap files--Linux supports up to 16 swap
areas, each of up to 128Mb.
<P>Very old kernels only supported swap partition sizes up to 16Mb.
<P>Linux on machines with 8KB paging, like Alpha
and Sparc64, support a swap partition up to 512KB.  The
128KB limitation comes from PAGE_SIZE*BITSPERBYTE on machines with 4KB
paging, but is 512KB on machines with 8KB paging.  The limit is due to
the use of a single page allocation map.
<P>The file <CODE>mm/swapfile.c</CODE> has all of the gory details.
<P>
<P>
<P>[Peter Moulder, Gordon Weast]
<P>===============================================================================
<P>
<HR>
<A HREF="Linux-FAQ-8.html"><IMG SRC="next.gif" ALT="Next"></A>
<A HREF="Linux-FAQ-6.html"><IMG SRC="prev.gif" ALT="Previous"></A>
<A HREF="Linux-FAQ.html#toc7"><IMG SRC="toc.gif" ALT="Contents"></A>
</BODY>
</HTML>
