Section 2.1. Common Commands


2.1. Common Commands

Following are lists of commonly used system administration commands.

2.1.1. Clocks

Command

Action

hwclock

Manage hardware clock.

rdate

Get time from network time server.

zdump

Print list of time zones.

zic

Create time-conversion information files.


2.1.2. Daemons

Command

Action

apmd

Advanced Power Management daemon.

atd

Queue commands for later execution.

bootpd

Internet Boot Protocol daemon.

cupsd

Printer daemon.

fingerd

Finger daemon.

ftpd

File Transfer Protocol daemon.

imapd

IMAP mailbox server daemon.

klogd

Manage syslogd.

mountd

NFS mount request server.

named

Internet domain nameserver.

nfsd

NFS daemon.

pppd

Maintain Point-to-Point Protocol (PPP) network connections.

rdistd

Remote file distribution server.

rexecd

Remote execution server.

rlogind

rlogin server.

routed

Routing daemon.

rpc.rusersd

Remote users server.

rpc.statd

NFS status daemon.

rshd

Remote shell server.

rwhod

Remote who server.

sshd

Secure shell daemon.

syslogd

System logging daemon.

talkd

Talk daemon.

tcpd

TCP network daemon.

tftpd

Trivial File Transfer Protocol daemon.

xinetd

Extended Internet services daemon. Starts other services as needed.

ypbind

NIS binder process.

yppasswdd

NIS password modification server.

ypserv

NIS server process.


2.1.3. Hardware

Command

Action

agetty

Start user session at terminal.

arp

Manage the ARP cache.

cardctl

Control PCMCIA cards.

cardmgr

PCMCIA card manager daemon.

fdisk

Maintain disk partitions.

hdparm

Get and set hard drive parameters.

kbdrate

Manage the keyboard's repeat rate.

ramsize

Print information about RAM disk.

setkeycodes

Change keyboard scancode-to-keycode mappings.

setserial

Set serial port information.

slattach

Attach serial lines as network interfaces.


2.1.4. Host Information

Command

Action

arch

Print machine architecture.

dig

Query Internet domain nameservers.

dnsdomainname

Print DNS domain name.

domainname

Print NIS domain name.

free

Print memory usage.

host

Print host and zone information.

hostname

Print or set hostname.

uname

Print host information.


2.1.5. Installation

Command

Action

cpio

Copy files to and from archives.

install

Copy files into locations providing user access and set permissions.

rdist

Distribute files to remote systems.

tar

Copy files to or restore files from an archive medium.


2.1.6. Mail

Command

Action

fetchmail

Retrieve mail from remote servers.

formail

Convert input to mail format.

mailq

Print a summary of the mail queue.

makemap

Update sendmail's database maps.

newaliases

Rebuild sendmail's alias database.

rmail

Handle uucp mail.

sendmail

Send and receive mail.


2.1.7. Managing Filesystems

To Unix systems, a filesystem is a device (such as a partition) that is formatted to store files. Filesystems can be found on hard drives, floppies, CD-ROMs, USB drives, or other storage media that permit random access.

The exact format and means by which the files are stored are not important; the system provides a common interface for all filesystem types that it recognizes. By default, almost all modern distributions of Linux use a journaling filesystem. When the kernel interacts with a journalling filesystem, writes to disk are first written to a log or journal before they are written to disk. This slows down writes to the filesystem, but reduces the risk of data corruption in the event of a power outage. It also speeds up reboots after a system unexpectedly loses power.

Most current Linux distributions default to the Third Extended (ext3) Filesystem. The ext3 filesystem was developed primarily for Linux and supports 256-character filenames and 4-terabyte maximum filesystem size. This ext3 filesystem is essentially a Second Extended (ext2) filesystem with an added journal. Since it is in all other ways identical to the ext2 system, it is both forward- and backward-compatible with ext2--all ext2 utilities work with ext3 filesystems.

Although not covered in this edition of Linux in a Nutshell, Linux supports three other open source journaling filesystems: IBM's Journaled Filesystem (JFS), SGI's Extensible Filesystem (XFS), and the Naming System Venture's Reiser Filesystem (ReiserFS). In some situations these can be faster than ext3. Some Linux distributions use these alternative filesystems by default. Other common filesystems include the FAT and VFAT filesystems, which allow files on partitions and floppies of Microsoft Windows systems to be accessed under Linux, and the ISO 9660 filesystem used by CD-ROMs.

Command

Action

debugfs

Debug ext2 filesystem.

dosfsck

Check and repair a DOS or VFAT filesystem.

dump

Back up data from a filesystem.

dumpe2fs

Print information about superblock and blocks group.

e2fsck

Check and repair an ext2 filesystem.

e2image

Store disaster-recovery data for an ext2 filesystem.

edquota

Edit filesystem quotas with vim.

fdformat

Format floppy disk.

fsck

Another name for e2fsck.

fsck.ext2

Check and repair an ext2 filesystem.

mke2fs

Make a new ext2 filesystem.

mkfs

Make a new filesystem.

mkfs.ext2

Another name for mke2fs.

mkfs.ext3

Yet another name for mke2fs.

mklost+found

Make lost+found directory.

mkraid

Set up a RAID device.

mkswap

Designate swapspace.

mount

Mount a filesystem.

quotacheck

Audit stored quota information.

quotaon

Enforce quotas.

quotaoff

Do not enforce quotas.

quotastats

Display kernel quota statistics.

raidstart

Activate a RAID device.

raidstop

Turn off a RAID device.

rdev

Describe or change values for root filesystem.

repquota

Display quota summary.

resize2fs

Enlarge or shrink an ext2 filesystem.

restore

Restore data from a dump to a filesystem.

rootflags

List or set flags to use in mounting root filesystem.

setquota

Edit filesystem quotas.

showmount

List exported directories on a remote host.

swapoff

Cease using device for swapping.

swapon

Begin using device for swapping.

sync

Write filesystem buffers to disk.

tune2fs

Manage an ext2 filesystem.

umount

Unmount a filesystem.

warnquota

Mail disk usage warnings to users.


2.1.8. Managing the Kernel

Command

Action

depmod

Create module dependency listing.

lsmod

List kernel modules.

modinfo

Print kernel module information.

modprobe

Load and remove a module and its dependent modules.

sysctl

Examine or modify kernel parameters at runtime.


2.1.9. Networking

Command

Action

ifconfig

Manage network interfaces.

iptables

Administer firewall facilities (2.4 kernel).

named

Translate between domain names and IP addresses.

nameif

Assign names to network devices.

netstat

Print network status.

nfsstat

Print statistics for NFS and RPC.

nsupdate

Submit dynamic DNS update requests.

portmap

Map daemons to ports.

rarp

Manage RARP table.

rndc

Send commands to a BIND nameserver.

route

Manage routing tables.

routed

Dynamically keep routing tables up to date.

rpcinfo

Report RPC information.

ruptime

Check how long remote system has been up.

rwho

Show who is logged into remote system.

traceroute

Trace network route to remote host.

wvdial

Establish dial-up IP connections.


2.1.10. Printing

Command

Action

accept

Tell printer daemon to accept jobs.

lpadmin

Configure printer and class queues.

lpinfo

Show available printers and drivers.

lpmove

Move a print job to a different queue.

reject

Tell printer daemon to reject jobs.

tunelp

Tune the printer parameters.


2.1.11. Security and System Integrity

Command

Action

badblocks

Search for bad blocks.

chroot

Change root directory.


2.1.12. Starting and Stopping the System

Command

Action

chkconfig

Manage which services run in a runlevel.

ctrlaltdel

Shut down, then soft reboot system.

halt

Stop or shut down system.

init

Change runlevel.

reboot

Shut down, then hard reboot system.

runlevel

Print system runlevel.

shutdown

Shut down system.

telinit

Change the current runlevel.

uptime

Display uptimes of local machines.


2.1.13. System Activity and Process Management

A number of additional commands in Chapter 3 are particularly useful in controlling processes, including kill, killall, pidof, ps, and who.

Command

Action

fuser

Identify processes using file or filesystem.

renice

Change the priority of running processes.

top

Show most CPU-intensive processes.

vmstat

Print virtual-memory statistics and process statistics.


2.1.14. Users

Command

Action

chpasswd

Change multiple passwords.

groupadd

Add a new group.

groupdel

Delete a group.

groupmod

Modify groups.

grpck

Check the integrity of group system files.

grpconv

Convert group file to shadow group file.

lastlog

Generate report of last user login times.

newusers

Add new users in a batch.

pwck

Check the integrity of password system files.

pwconv

Convert password file to shadow passwords.

rusers

Print who-style information on remote machines.

rwall

Print a message to remote users.

useradd

Add a new user.

userdel

Delete a user and that user's home directory.

usermod

Modify a user's information.

w

List logged-in users.

wall

Write to all users.

whoami

Show how you are currently logged in.


2.1.15. Miscellaneous

Command

Action

anacron

Schedule commands for periodic execution.

atrun

Schedule commands for later execution.

cron

Schedule commands for specific times.

dmesg

Print bootup messages after the system is up.

ldconfig

Update library links and do caching.

logger

Send messages to the system logger.

logrotate

Compress and rotate system logs.

run-parts

Run all scripts in a directory.




Linux in a Nutshell
Linux in a Nutshell
ISBN: 0596154488
EAN: 2147483647
Year: 2004
Pages: 147

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net