Sunday, August 30, 2009

Linux Commands Part 2

This is the list of commonly used commands in systems administration.

Clocks
hwclock Manage hardware clock.
netdate Set clock according to host's clock.
rdate Manage time server.
zdump Print list of time zones.
zic Create time conversion information files.


Host Information
arch Print machine architecture.
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.
nslookup Query Internet domain name servers.
uname Print host information.

Networking
dip Establish dial-up IP connections.
gdc Administer gated routing daemon.
ifconfig Manage network interfaces.
ipchains Administer firewall facilities (2.2 kernel).
iptables Administer firewall facilities (2.4 kernel).
named Translate between domain names and IP addresses.
netstat Print network status.
portmap Map daemons to ports.
rarp Manage RARP table.
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 in to remote system.
systat Show status of remote systems.
traceroute Trace network route to remote host.

Starting and Stopping the System
bootpd Internet Boot Protocol daemon.
bootpgw Internet Boot Protocol gateway.
bootptest Test bootpd.
halt Stop or shut down system.
init Change runlevel.
reboot Shut down, then reboot system.
runlevel Print system runlevel.
shutdown Shut down system.
telinit Change the current runlevel.
uptime Display uptimes of local machines.

System Activity and Process Management
fuser Identify processes using file or filesystem.
psupdate Update /boot/psupdate.
renice Change the priority of running processes.
top Show most CPU-intensive processes.

Users
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 her home directory.
usermodModify a user's information.
w List logged-in users.
wall Write to all users.
whoami Show how you are currently logged in.

Security and System Integrity
badblocks Search for bad blocks.
chroot Change root directory.

Printing
lpc Control line printer.
tunelp Tune the printer parameters.

File Systems Management
debugfs Debug extfs filesystem.
dosfsck Check and repair a DOS or VFAT filesystem.
dumpe2fs Print information about superblock and blocks group.
e2fsck Check and repair a second extended filesystem.
fdformat Format floppy disk.
fsck Check and repair filesystem.
fsck.minix Check and repair a MINIX filesystem.
fuser List processes using a filesystem.
mke2fs Make new second extended filesystem.
mkfs Make new filesystem.
mkfs.ext2 Another name for mke2fs.
mkfs.minix Make new MINIX filesystem.
mklost+found Make lost+found directory.
mkraid Set up a RAID device.
mkswap Designate swap space.
mount Mount a filesystem.
raidstart Activate a RAID device.
raidstop Turn off a RAID device.
rdev Describe or change values for root filesystem.
rootflags List or set flags to use in mounting root filesystem.
showmount List exported directories.
swapdev Display or set swap device information.
swapoff Cease using device for swapping.
swapon Begin using device for swapping.
sync Write filesystem buffers to disk.
tune2fs Manage second extended filesystem.
umount Unmount a filesystem.


Mail
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.
rmail Handle uucp mail.
sendmail Send and receive mail.

Installation
cpio Copy file 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.

Hardware
agetty Start user session at terminal.
arp Manage the ARP cache.
cardctl Control PCMCIA cards.
cardmgr PCMCIA card manager daemon.
cfdisk Maintain disk partitions (graphical interface).
fdisk Maintain disk partitions.
getty Start user session at terminal.
kbdrate Manage the keyboard's repeat rate.
ramsize Print information about RAM disk.
setserial Set serial port information.
slattach Attach serial lines as network interfaces.

Managing the Kernel
depmod Create module dependency listing.
insmod Install new kernel module.
lsmod List kernel modules.
modprobe Load new module and its dependent modules.
rmmod Remove module.

Miscellaneous
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.
rstat Display host's system status.
run-parts Run all scripts in a directory.

Linux Commands

These commands will work with most (if not all) distributions of Linux as well as most (?) implementations of Unix.

Communication
ftp - File Transfer Protocol.
login - Sign on.
rlogin - Sign on to remote system.
rsh - Run shell or single command on remote system.
talk -Exchange messages interactively with other terminals.
telnet - Connect to another system.
tftp - Trivial file transfer protocol.


Comparisons

cmp - Compare two files, byte by byte.
comm - Compare items in two sorted files.
diff - Compare two files, line by line.
diff3 - Compare three files.

File Management
cat - Concatenate files or display them.
chfn -Change user information for finger, email, etc.
cksum - Compute checksum.
chmod -Change access modes on files.
chsh - Change login shell.
cp - Copy files.
csplit -Break files at specific locations.
dd -Copy files in raw disk form.
file - Determine a file's type.
head - Show the first few lines of a file.
less - Display files by screenful.
ln - Create filename aliases.
ls - List files or directories.
merge - Merge changes from different files.
mkdir -Create a directory.
more - Display files by screenful.
mv - Move or rename files or directories.
newgrp - Change current group.
pwd - Print working directory.
rcp - Copy files to remote system.
rm -Remove files.
rmdir -Remove directories.
split - Split files evenly.
tail - Show the last few lines of a file.
wc - Count lines, words, and characters.


Printing
lpq - Show status of print jobs.
lpr - Send to the printer.
lprm - Remove print job.
lpstat - Get printer status.
pr - Format and paginate for printing.

Programming
ar - Create and update library files.
as - Generate object file.
bison - Generate parsing tables.
cpp - Preprocess C code.
flex - Lexical analyzer.
g++ - GNU C++ compiler.
gcc - GNU C compiler.
ld - Link editor.
m4 - Macro processor.
make - Create programs.
ranlib - Regenerate archive symbol table.
rpcgen - Translate RPC to C code.
yacc - Generate parsing tables.

Program Maintenance
cvs - Manage different versions (revisions) of source files.
etags - Generate symbol list for use with the Emacs editor.
gctags - Generate symbol list for use with the vi editor.
gdb - GNU debugger.
gprof - Display object file's profile data.
imake - Generate makefiles for use with make.
make - Maintain, update, and regenerate related programs and files.
nm - Display object file's symbol table.
patch - Apply patches to source code.
rcs - Manage different versions (revisions) of source files.
size - Print the size of an object file in bytes.
strace - Trace system calls and signals.
strip - Strip symbols from an object file.

Searching
apropos - Search manpages for topic.
egrep - Extended version of grep.
fgrep - Search files for literal words.
find - Search the system for filenames.
grep - Search files for text patterns.
strings - Search binary files for text patterns.
whereis - Find command.

Shell Programming
echo - Repeat command-line arguments on the output.
expr - Perform arithmetic and comparisons.
printf - Format and print command-line arguments.
sleep - Pause during processing.
test - Test a condition.

Storage
bzip2 - Compress files to free up space.
cpio - Create and unpack file archives.
gunzip - Expand compressed (.gz and .Z) files (preferred).
gzip - Compress files to free up space.
shar - Create shell archive.
tar - Copy files to or restore files from an archive medium.
zcat - Display contents of compressed files.

System Status
at - Execute commands later.
atq - Show jobs queued by at.
atrm - Remove job queued by at.
chgrp - Change file group.
chown - Change file owner.
crontab - Automate commands.
date - Display or set date.
df - Show free disk space.
du - Show disk usage.
env - Show environment variables.
finger - Display information about users.
kill - Terminate a running command.
printenv - Show environment variables.
ps - Show processes.
stty - Set or display terminal settings.
who - Show who is logged on.

Text Processing
col - Process control characters.
cut - Select columns for display.
ex - Line editor underlying vi.
expand - Convert tabs to spaces.
fmt - Produce roughly uniform line lengths.
fold - Break lines.
gawk - Process lines or records one by one.
ghostscript - Display PostScript or PDF file.
groff - Format troff input.
ispell - Interactively check spelling.
join - Merge different columns into a database.
paste - Merge columns or switch order.
rev - Print lines in reverse.
sed - Noninteractive text editor.
sort - Sort or merge files.
tac - Print lines in reverse.
tr - Translate (redefine) characters.
uniq - Find repeated or unique lines in a file.
vi - Visual text editor.
xargs - Process many arguments in manageable portions.

Miscellaneous
banner - Make posters from words.
bc - Arbitrary precision calculator.
cal - Display calendar.
clear - Clear the screen.
man - Get information on a command.
nice - Reduce a job's priority.
nohup - Preserve a running job after logging out.
passwd - Set your login password.
script - Produce a transcript of your login session.
su - Become a superuser.
tee - Simultaneously store output in file and send to screen.
which - Print pathname of a command.

History of Linux

Before we start with Linux tutorials, it's better to understand it's history to understand the philosophy behind and fully appreciate the best operating system in the planet.


From Thinkquest's "The Penguins Guide to Linux":

Linux is a freely distributable version of UNIX. UNIX is one of the most popular operating systems for networking worldwide because of its large support base and distribution. Linus Torvalds, who was then a student at the University of Helsinki in Finland, developed Linux in 1991. It was released for free on the Internet and generated the largest software-development phenomena of all time. Because of GNU software (GNU being an acronym for Gnu's Not UNIX) created by the Free Software Foundation, Linux has many utilities to offer. The Free Software Foundation offers royalty-free software to programmers and developers. From the very beginning, Linux has been entwined with GNU software. From 1991, Linux quickly developed on hackers' web pages as the alternative to Windows and the more expensive UNIX systems. read more ...