Наши партнеры

Книги по Linux (с отзывами читателей)

Библиотека сайта rus-linux.net

Next Previous Contents

7. How do I do this or find out that ... ?


7.1 How can I get scrollback in text mode?

With the default US keymap you can use Shift with the PageUp and PageDown keys (NB: these must be the grey ones, not the ones on the numeric keypad!). With other keymaps check the maps in /usr/lib/keytables; you can remap the ScrollUp and ScrollDown keys to be whatever you like--for example, in order to remap them to keys that exist on an 84-key AT keyboard.

You can't increase the amount of scrollback, because of the way it is implemented using the video memory to store the scrollback text, though you may be able to get more scrollback in each virtual console by reducing the total number of VC's--see linux/tty.h.


7.2 How do I switch virtual consoles? How do I enable them?

In text mode, press Left Alt-F1 to Alt-F12 to select the consoles tty1 to tty12; Right Alt-F1 gives tty13 and so on. To switch out of X windows you must press Ctrl-Alt-F1, etc; Alt-F5 or whatever will switch back.

If you want to use a VC for ordinary login you need to list it in /etc/inittab, which controls which terminals and virtual consoles have login prompts. NB: X needs at least one free VC in order to start.

Kernels earlier than around 1.1.59 have a compiled-in limit on the number of consoles, for which the default is 8. See NR_CONSOLES in linux/include/linux/tty.h. Newer kernels allocate them dynamically, up to a maximum of 63.


7.3 How do I set the time zone?

Change directory to /usr/lib/zoneinfo; get the timezone package if you don't have this directory. The source is available as sunsite.unc.edu/pub/Linux/system/admin/time/timesrc-1.2.tar.gz.

Then make a symbolic link named localtime pointing to one of the files in this directory (or a subdirectory), and one called posixrules pointing to localtime. For example:

   ln -sf US/Mountain localtime
   ln -sf localtime posixrules
This change will take effect immediately--try date(1).

Don't try to use the TZ variable--leave it unset.

You should also make sure that your Linux kernel clock is set to the correct GMT time--type date -u and check that the correct universal time is displayed.


7.4 What version of Linux and what machine name am I using?


   uname -a


7.5 How can I enable or disable core dumps?

By using the ulimit(1) command in bash(1), the limit command in tcsh(1), or the rlimit command in ksh(1). See the appropriate manual page for details.

This setting affects all programs run from that shell (directly or indirectly), not the whole system.

If you wish to enable or disable coredumping for all processes by default, you can change the default setting in linux/sched.h--see the definition of INIT_TASK, and look also in linux/resource.h.


7.6 How do I upgrade/recompile my kernel?

See the Kernel HOWTO or the README files which comes with the kernel release on ftp.cs.helsinki.fi, in /pub/Software/Linux/Kernel and mirrors. (See `` Where can I get Linux material by FTP? '') You may already have a version of the kernel source code installed on your system, but if you got it as 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.)

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 make zlilo.

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 `` What mailing lists are there? .'')


7.7 Can I have more than 3 serial ports by sharing interrupts?

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.

See the Serial HOWTO for information about possible solutions to and workarounds for this problem.


7.8 How do I make a bootable floppy?

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).

If you build the kernel (or tell LILO to tell the kernel) to have a ramdisk the same size as the floppy the ramdisk will be loaded at boot-time and mounted as root in place of the floppy.

See the Bootdisk HOWTO.


7.9 How do I remap my keyboard to UK, French, etc.?

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 to go with your kernel version. 0.90 should work with kernel versions from 1.0.

For older kernels you have to edit the top-level kernel Makefile, in /usr/src/linux.

You may find more helpful information in The Linux keystroke and console HOWTO, by Andries Brouwer, at sunsite.unc.edu/pub/Linux/docs/HOWTO


7.10 How do I get NUM LOCK to default to on?

Use the setleds program, for example (in /etc/rc.local or one of the /etc/rc.d/* files):

   for t in 1 2 3 4 5 6 7 8
        setleds +num < /dev/tty$t > /dev/null
setleds is part of the kbd package (see Q7.9 `How do I remap my keyboard to UK, French, etc?').

Alternatively, patch your kernel. You need to arrange for KBD_DEFLEDS to be defined to (1 << VC_NUMLOCK) when compiling drivers/char/keyboard.c.


7.11 How can I have more than 128Mb of swap?

Use several swap partitions or swap files--Linux supports up to 16 swap areas, each of up to 128Mb.

Very old kernels only supported swap area sizes up to 16Mb.

Peter Moulder says that Linux on machines with 8MB, paging like Alpha and Sparc64, support a swap partition up to 512MB. He says that the 128MB limitation comes from PAGE_SIZE*BITSPERBYTE on machines with 4MB paging, but is 512MB on machines with 8MB paging. The file mm/swapfile.c has all of the gory details.


7.12 Miscellaneous information and questions answered.


7.13 How do I program XYZ under Linux?

Read the manuals, or a good book on Unix. Manual pages (type ``man man'') are usually a good source of reference information on exactly how to use a particular command or function.

There is also a lot of GNU Info documentation, which is often more useful as a tutorial. Run Emacs and type C-h i, or type info info if you don't have or don't like Emacs. Note that the Emacs libc node doesn't exactly describe the Linux libc (which is more like a traditional Unix libc, not having some of the GNU oddities), but it's close enough to make a fair tutorial in Unix C programming.

The latest release of the Linux manual pages, a collection of useful GNU Info documentation, and various other information related to programming Linux can be found on sunsite.unc.edu in /pub/Linux/docs/man-pages.


7.14 What's all this about ELF?

See the ELF HOWTO by Daniel Barlow--note, this is not the file move-to-elf, which is a blow-by-blow account of how to upgrade to ELF manually.

Linux has two different formats for executables, object files, and object code libraries, known as `ELF' (the old format is called `a.out'). This will have many advantages, including better support for shared libraries and dynamic linking.

Both a.out and ELF binaries can coexist on a system. However, they use different shared C libraries, both of which will have to be installed to do this.

If you want to find out whether your system can run ELF binaries, look in /lib for a filename libc.so.5. If this exists it probably can. If you want to know whether your installation actually is ELF you can pick a representative program, like ls, and run file on it:

   -chiark:~> file /bin/ls
   /bin/ls: Linux/i386 impure executable (OMAGIC) - stripped

   valour:~> file /bin/ls
   /bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1, stripped
There is a patch to get 1.2.x to compile using the ELF compilers, and produce ELF core dumps, at tsx-11.mit.edu in /pub/packages/GCC. You do not need the patch merely to run ELF binaries. 1.3.x and later do not need a patch at all.


7.15 What is a .gz file ? And a .tgz ? And ... ?

.gz (and .z) files have been compressed using GNU gzip. You need to use gunzip (which is as a symlink to the gzip command which comes with most Linux installations) to unpack the file.

.taz and .tz are tarfiles (made with Unix tar) compressed using standard Unix compress.

.tgz (or .tpz) is a tarfile compressed with gzip.

.lsm is a Linux Software Map entry, in the form of a short text file. Details about the LSM and the LSM itself are available in the docs subdirectory on sunsite.unc.edu.

.deb is a Debian Binary Package - the binary package format used by the Debian GNU/Linux distribution. It is manipulated using dpkg and dpkg-deb (available on Debian systems and from ftp.debian.org).

.rpm is a Red Hat RPM package, which is used in the Red Hat distribution. These can be found on ftp.redhat.com.

The ``file'' command can often tell you what a file is.

If you find that gzip complains when you try to uncompress a gzipped file you probably downloaded it in ASCII mode by mistake. You must download most things in binary mode - remember to type binary as a command in FTP before using get to get the file.


7.16 What does VFS stand for?

Virtual File System. It's the abstraction layer between the user and real file systems like ext2, minix and msdos. Among other things, its job is to flush the read buffer when it detects a disk change on the floppy disk drive:

   VFS: Disk change detected on device 2/0

7.17 What is a BogoMip?

`BogoMips' is a contraction of `Bogus MIPS'. MIPS stands for (depending who you listen to) Millions of Instructions per Second, or Meaningless Indication of Processor Speed.

The number printed at boot-time is the result of a kernel timing calibration, used for very short delay loops by some device drivers.

As a very rough guide the BogoMips will be approximately:

     386SX              clock * 0.14
     386DX              clock * 0.18
     486Cyrix/IBM       clock * 0.33
     486SX/DX/DX2       clock * 0.50
     586                clock * 0.39
If the number you're seeing is wildly lower than this you may have the Turbo button or CPU speed set incorrectly, or have some kind of caching problem (as described in Q6.5 `When I add more memory it slows to a crawl.'.)

For values people have seen with other, rarer, chips, see the BogoMips Mini-HOWTO, on sunsite.unc.edu in /pub/Linux/docs/howto/mini/BogoMips.


7.18 What is the Linux Journal and where can I get it?

Linux Journal is a monthly magazine (printed on paper) that is available on newsstands and via subscription worldwide. Email linux@ssc.com for details. Their URL is http://www.ssc.com/.


7.19 How many people use Linux?

Linux is freely available, and no one is required to register their copies with any central authority, so it is difficult to know. Several businesses are now surviving solely on selling and supporting Linux, and very few Linux users use those businesses, relatively speaking. The Linux newsgroups are some of the most heavily read on the Net, so the number is likely in the hundreds of thousands, but firm numbers are hard to come by.

However, one brave soul, Harald T. Alvestrand, Harald.T.Alvestrand@uninett.no, has decided to try, and asks that if you use Linux, you send a message to linux-counter@uninett.no with one of the following subjects: `I use Linux at home', `I use Linux at work', or `I use Linux at home and at work'. He will also accept `third-party' registrations--ask him for details.

Alternatively, you can register using the WWW forms found at http://domen.uninett.no/~hta/linux/counter.html.

He posts his counts to aun.uninett.no in /pub/misc/linux-counter or at the web page above.


7.20 How should I pronounce Linux?

This is a matter of religious debate, of course!

If you want to hear Linus himself say how he pronounces it, download english.au or swedish.au from ftp.funet.fi (in /pub/Linux/PEOPLE/Linus/SillySounds). If you have a soundcard or the PC-speaker audio driver you can hear them by typing

   cat english.au >/dev/audio
The difference isn't in the pronunciation of Linux but in the language Linus uses to say hello.

For the benefit of those of you who don't have the equipment or inclination: Linus pronounces Linux approximately as Leenus, where the ee is as in feet but rather shorter and the u is like a much shorter version of the French eu sound in peur (pronouncing it as the u in put is probably passable).


Next Previous Contents