Category Archives: Linux Man Pages - Page 2



modinfo – program to show information about a Linux Kernel module

modinfo [ -0 ] [ -F field ] [ -k kernel ] [ modulename|filename … ]

modinfo -V

modinfo -h

modinfo extracts information from the Linux Kernel modules given on the
command line. If the module name is not a filename, then the /lib/mod-
ules/version directory is searched, as done by modprobe(8).

modinfo by default lists each attribute of the module in form fieldname
: value, for easy reading. The filename is listed the same way
(although it’s not really an attribute).

This version of modinfo can understand modules of any Linux Kernel

-V –version
Print the modinfo version. Note BACKWARDS COMPATIBILITY below:
you might be printing the version of modinfo.old.

-F –field
Only print this field value, one per line. This is most useful
for scripts. Field names are case-insenitive. Common fields
(which may not be in every module) include author, description,
license, param, depends, and alias. There are often multiple
param, alias and depends fields. The special field filename
lists the filename of the module.

-k kernel
Provide information about a kernel other than the running one.
This is particularly useful for distributions needing to extract
information from a newly installed (but not yet running) set of
kernel modules. For example, you wish to find which firmware
files are needed by various modules in a new kernel for which
you must make an initrd image prior to booting.

-0 –null
Use the ASCII zero character to separate field values, instead
of a new line. This is useful for scripts, since a new line can
theoretically appear inside a field.

-a -d -l -p -n
These are shortcuts for author, description, license. param and
filename respectively, to ease the transition from the old modu-
tils modinfo.

This version of modinfo is for kernel modules 2.5.48 and above. If it
detects a kernel with support for old-style modules, it will attempt to
run modprobe.old in its place, so it is completely transparent to the

Note that the output of this version of modinfo is simpler and more
regular than the older version: scripts attempting to use the default
output may get confused with complex fields.

You can force the new modinfo to always be used, by setting the
NEW_MODINFO environment variable.

This manual page Copyright 2003, Rusty Russell, IBM Corporation.

modprobe(8), modinfo.old(8)

22 August 2008 MODINFO(8)

Technorati Tags: ,



mkfs – build a Linux file system

mkfs [ -V ] [ -t fstype ] [ fs-options ] filesys [ blocks ]

mkfs is used to build a Linux file system on a device, usually a hard
disk partition. filesys is either the device name (e.g. /dev/hda1,
/dev/sdb2). blocks is the number of blocks to be used for the file

The exit code returned by mkfs is 0 on success and 1 on failure.

In actuality, mkfs is simply a front-end for the various file system
builders (mkfs.fstype) available under Linux. The file system-specific
builder is searched for in a number of directories like perhaps /sbin,
/sbin/fs, /sbin/fs.d, /etc/fs, /etc (the precise list is defined at
compile time but at least contains /sbin and /sbin/fs), and finally in
the directories listed in the PATH environment variable. Please see
the file system-specific builder manual pages for further details.

-V Produce verbose output, including all file system-specific com-
mands that are executed. Specifying this option more than once
inhibits execution of any file system-specific commands. This
is really only useful for testing.

-t fstype
Specifies the type of file system to be built. If not speci-
fied, the default file system type (currently ext2) is used.

File system-specific options to be passed to the real file sys-
tem builder. Although not guaranteed, the following options are
supported by most file system builders.

-c Check the device for bad blocks before building the file system.

-l filename
Read the bad blocks list from filename

-v Produce verbose output.

All generic options must precede and not be combined with file system-
specific options. Some file system-specific programs do not support
the -v (verbose) option, nor return meaningful exit codes. Also, some
file system-specific programs do not automatically detect the device
size and require the blocks parameter to be specified.

David Engel (
Fred N. van Kempen (
Ron Sommeling (
The manual page was shamelessly adapted from Remy Card’s version for
the ext2 file system.

fs(5), badblocks(8), fsck(8), mkdosfs(8), mke2fs(8), mkfs.bfs(8),
mkfs.ext2(8), mkfs.ext3(8), mkfs.minix(8), mkfs.msdos(8), mkfs.vfat(8),
mkfs.xfs(8), mkfs.xiafs(8)

The mkfs command is part of the util-linux-ng package and is available

Version 1.9 Jun 1995 MKFS(8)

Technorati Tags: ,


MKNOD(1) User Commands MKNOD(1)

mknod – make block or character special files


Create the special file NAME of the given TYPE.

-Z, –context=CTX
set the SELinux security context of NAME to CTX

Mandatory arguments to long options are mandatory for short options

-m, –mode=MODE
set file permission bits to MODE, not a=rw – umask

–help display this help and exit

output version information and exit

Both MAJOR and MINOR must be specified when TYPE is b, c, or u, and
they must be omitted when TYPE is p. If MAJOR or MINOR begins with 0x
or 0X, it is interpreted as hexadecimal; otherwise, if it begins with
0, as octal; otherwise, as decimal. TYPE may be:

b create a block (buffered) special file

c, u create a character (unbuffered) special file

p create a FIFO

NOTE: your shell may have its own version of mknod, which usually
supersedes the version described here. Please refer to your shell’s
documentation for details about the options it supports.

Written by David MacKenzie.

Report bugs to <>.

Copyright © 2008 Free Software Foundation, Inc. License GPLv3+: GNU
GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


The full documentation for mknod is maintained as a Texinfo manual. If
the info and mknod programs are properly installed at your site, the

info coreutils ‘mknod invocation’

should give you access to the complete manual.

GNU coreutils 6.12 May 2008 MKNOD(1)

Technorati Tags: ,


MKSWAP(8) Linux Programmer’s Manual MKSWAP(8)

mkswap – set up a Linux swap area

mkswap [-c] [-vN] [-f] [-p PSZ] [-L label] [-U uuid] device [size]

mkswap sets up a Linux swap area on a device or in a file.

(After creating the swap area, you need the swapon command to start
using it. Usually swap areas are listed in /etc/fstab so that they can
be taken into use at boot time by a swapon -a command in some boot

The device argument will usually be a disk partition (something like
/dev/hda4 or /dev/sdb7) but can also be a file. The Linux kernel does
not look at partition Id’s, but many installation scripts will assume
that partitions of hex type 82 (LINUX_SWAP) are meant to be swap parti-
tions. (Warning: Solaris also uses this type. Be careful not to kill
your Solaris partitions.)

The size parameter is superfluous but retained for backwards compati-
bility. (It specifies the desired size of the swap area in 1024-byte
blocks. mkswap will use the entire partition or file if it is omitted.
Specifying it is unwise – a typo may destroy your disk.)

The PSZ parameter specifies the page size to use. It is almost always
unnecessary (even unwise) to specify it, but certain old libc versions
lie about the page size, so it is possible that mkswap gets it wrong.
The symptom is that a subsequent swapon fails because no swap signature
is found. Typical values for PSZ are 4096 or 8192.

Linux knows about two styles of swap areas, old style and new style.
The last 10 bytes of the first page of the swap area distinguishes
them: old style has `SWAP_SPACE’, new style has `SWAPSPACE2′ as signa-

In the old style, the rest of this first page was a bit map, with a 1
bit for each usable page of the swap area. Since the first page holds
this bit map, the first bit is 0. Also, the last 10 bytes hold the
signature. So, if the page size is S, an old style swap area can
describe at most 8*(S-10)-1 pages used for swapping. With S=4096 (as
on i386), the useful area is at most 133890048 bytes (almost 128 MiB),
and the rest is wasted. On an alpha and sparc64, with S=8192, the use-
ful area is at most 535560992 bytes (almost 512 MiB).

The old setup wastes most of this bitmap page, because zero bits denote
bad blocks or blocks past the end of the swap space, and a simple inte-
ger suffices to indicate the size of the swap space, while the bad
blocks, if any, can simply be listed. Nobody wants to use a swap space
with hundreds of bad blocks. (I would not even use a swap space with 1
bad block.) In the new style swap area this is precisely what is done.

The maximum useful size of a swap area depends on the architecture and
the kernel version. It is roughly 2GiB on i386, PPC, m68k, ARM, 1GiB
on sparc, 512MiB on mips, 128GiB on alpha and 3TiB on sparc64. For ker-
nels after 2.3.3 there is no such limitation.

Note that before 2.1.117 the kernel allocated one byte for each page,
while it now allocates two bytes, so that taking a swap area of 2 GiB
in use might require 2 MiB of kernel memory.

Presently, Linux allows 32 swap areas (this was 8 before Linux 2.4.10).
The areas in use can be seen in the file /proc/swaps (since 2.1.25).

mkswap refuses areas smaller than 10 pages.

If you don’t know the page size that your machine uses, you may be able
to look it up with “cat /proc/cpuinfo” (or you may not – the contents
of this file depend on architecture and kernel version).

To setup a swap file, it is necessary to create that file before ini-
tializing it with mkswap , e.g. using a command like

# dd if=/dev/zero of=swapfile bs=1024 count=65536

Note that a swap file must not contain any holes (so, using cp(1) to
create the file is not acceptable).

-c Check the device (if it is a block device) for bad blocks before
creating the swap area. If any are found, the count is printed.

-f Force – go ahead even if the command is stupid. This allows the
creation of a swap area larger than the file or partition it
resides on. On SPARC, force creation of the swap area. Without
this option mkswap will refuse to create a v0 swap on a device
with a valid SPARC superblock, as that probably means one is
going to erase the partition table.

-p PSZ Specify the page size to use.

-L label
Specify a label, to allow swapon by label. (Only for new style
swap areas.)

-v0 Create an old style swap area.

-v1 Create a new style swap area.

If no -v option is given, mkswap will default to new style, but use old
style if the current kernel is older than 2.1.117 (and also if
PAGE_SIZE is less than 2048). The new style header does not touch the
first block, so may be preferable, in case you have a boot loader or
disk label there. If you need to use both 2.0 and 2.2 kernels, use the
-v0 option when creating the swapspace.

Version 0 (-v0) swap space format is no longer supported in 2.5+ ker-

-U uuid
Specify the uuid to use. The default is to generate UUIDs.

fdisk(8), swapon(8)

The mkswap command is part of the util-linux-ng package and is avail-
able from

Linux 2.2.4 25 March 1999 MKSWAP(8)

Technorati Tags: ,


MORE(1) BSD General Commands Manual MORE(1)

more – file perusal filter for crt viewing

more [-dlfpcsu] [-num] [+/ pattern] [+ linenum] [file …]

More is a filter for paging through text one screenful at a time. This
version is especially primitive. Users should realize that less(1) pro-
vides more(1) emulation and extensive enhancements.

Command line options are described below. Options are also taken from
the environment variable MORE (make sure to precede them with a dash
(“-”)) but command line options will override them.

-num This option specifies an integer which is the screen size (in

-d more will prompt the user with the message “[Press space to con-
tinue, ‘q’ to quit.]” and will display “[Press ‘h’ for instruc-
tions.]” instead of ringing the bell when an illegal key is

-l more usually treats ^L (form feed) as a special character, and will
pause after any line that contains a form feed. The -l option will
prevent this behavior.

-f Causes more to count logical, rather than screen lines (i.e., long
lines are not folded).

-p Do not scroll. Instead, clear the whole screen and then display
the text.

-c Do not scroll. Instead, paint each screen from the top, clearing
the remainder of each line as it is displayed.

-s Squeeze multiple blank lines into one.

-u Suppress underlining.

+/ The +/ option specifies a string that will be searched for before
each file is displayed.

+num Start at line number num.

Interactive commands for more are based on vi(1). Some commands may be
preceded by a decimal number, called k in the descriptions below. In the
following descriptions, ^X means control-X.

h or ? Help: display a summary of these commands. If you forget all
the other commands, remember this one.

SPACE Display next k lines of text. Defaults to current screen

z Display next k lines of text. Defaults to current screen
size. Argument becomes new default.

RETURN Display next k lines of text. Defaults to 1. Argument
becomes new default.

d or ^D Scroll k lines. Default is current scroll size, initially
11. Argument becomes new default.


s Skip forward k lines of text. Defaults to 1.

f Skip forward k screenfuls of text. Defaults to 1.

b or ^B Skip backwards k screenfuls of text. Defaults to 1. Only
works with files, not pipes.

‘ Go to place where previous search started.

= Display current line number.

/pattern Search for kth occurrence of regular expression. Defaults to

n Search for kth occurrence of last r.e. Defaults to 1.

!<cmd> or :!<cmd>
Execute <cmd> in a subshell

v Start up an editor at current line. The editor is taken from
the environment variable VISUAL if defined, or EDITOR if
VISUAL is not defined, or defaults to “vi” if neither VISUAL
nor EDITOR is defined.

^L Redraw screen

:n Go to kth next file. Defaults to 1.

:p Go to kth previous file. Defaults to 1.

:f Display current file name and line number

. Repeat previous command

More utilizes the following environment variables, if they exist:

MORE This variable may be set with favored options to more.

SHELL Current shell in use (normally set by the shell at login

TERM Specifies terminal type, used by more to get the terminal
characteristics necessary to manipulate the screen.

vi(1) less(1)

Eric Shienbrood, UC Berkeley
Modified by Geoff Peck, UCB to add underlining, single spacing
Modified by John Foderaro, UCB to add -c and MORE environment variable

The more command appeared in 3.0BSD. This man page documents more ver-
sion 5.19 (Berkeley 6/29/88), which is currently in use in the Linux com-
munity. Documentation was produced using several other versions of the
man page, and extensive inspection of the source code.

The more command is part of the util-linux-ng package and is available

Linux 0.98 December 25, 1992 Linux 0.98

Technorati Tags: ,