Section 1.6. Beginner s Guide


1.6. Beginner's Guide

If you're just beginning to work on a Linux system, the abundance of commands might prove daunting. To help orient you, the following lists present a sampling of commands on various topics.

1.6.1. Communication

Command

Action

dig

Query DNS server.

ftp

File Transfer Protocol.

login

Sign on.

rsync

Transfer files, particularly across a network.

scp

Securely copy files to remote system.

ssh

Run shell or single command on remote system (secure).

talk

Exchange messages interactively with other terminals.

tftp

Trivial File Transfer Protocol.


1.6.2. Comparisons

Command

Action

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.

sdiff

Compare and interactively merge two files.


1.6.3. File Management

Command

Action

cat

Concatenate files or display them.

chfn

Change user information for finger, email, etc.

chgrp

Change group of files.

chmod

Change access modes on files.

chown

Change ownership of files.

chsh

Change login shell.

cksum

Compute checksum.

cp

Copy files.

csplit

Split a file into pieces with a specific size or 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.

hexdump

Display files in hexadecimal format.

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.

od

Display files in octal format.

pwd

Print working directory.

rm

Remove files.

rmdir

Remove directories.

shred

Securely delete files.

split

Split files evenly.

tac

Print lines of a file in reverse order.

tail

Show the last few lines of a file.

tailf

Follow the growth of a logfile.

touch

Update file timestamps and create the file if it doesn't exist.

wc

Count lines, words, and characters.


1.6.4. Media

Command

Action

cdda2wav

Rip a CD to create a computer-friendly WAV format.

cdparanoia

Rip a CD while providing extra features.

cdrdao

Copy a CD.

cdrecord

Record to a CD.

eject

Eject a removable disk or tape.

mkisofs

Generate a binary image from a directory tree.

mpg321

Play an MP3 file.

readcd

Read or write a data CD.

volname

Provide the volume name of a CD-ROM.


1.6.5. Printing

Command

Action

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.


1.6.6. Programming

Command

Action

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.

ldd

Print shared library dependencies.

m4

Macro processor.

make

Create programs.

ranlib

Regenerate archive symbol table.

rpcgen

Translate RPC to C code.

yacc

Generate parsing tables.


1.6.7. Program Maintenance

Command

Action

cvs

Manage different versions (revisions) of source files.

ctags

Generate symbol list for use with the vi editor.

etags

Generate symbol list for use with the Emacs editor.

gdb

GNU debugger.

gprof

Display object file's profile data.

make

Maintain, update, and regenerate related programs and files.

nm

Display object file's symbol table.

objcopy

Copy and translate object files.

objdump

Display information about object files.

patch

Apply patches to source code.

pmap

Print the memory map of a process.

size

Print the size of an object file in bytes.

strace

Trace system calls and signals.

strip

Strip symbols from an object file.


1.6.8. Searching

Command

Action

apropos

Search manpages for topic.

egrep

Extended version of grep.

fgrep

Search files for literal words.

find

Search the system for files by name and take a range of possible actions.

grep

Search files for text patterns.

locate

Search a preexisting database to show where files are on the system.

look

Search file for string at the beginning of lines.

strings

Search binary files for text patterns.

whereis

Find command.

which

Print pathname of a command.


1.6.9. Shell Programming

Command

Action

basename

Remove leading directory components from a path.

echo

Repeat command-line arguments on the output.

envsubst

Substitute the value of environment variables into strings.

expr

Perform arithmetic and comparisons.

mktemp

Generate temporary filename and create the file.

printf

Format and print command-line arguments.

sleep

Pause during processing.

test

Test a condition.


1.6.10. Storage

Command

Action

bzip2

Compress files to free up space.

cpio

Create and unpack file archives.

gunzip

Expand compressed (.gz and .Z) files.

gzip

Compress files to free up space.

tar

Copy files to or restore files from an archive medium.

zcat

Display contents of compressed files.

zforce

Force gzip files to have .gz extension.


1.6.11. System Status

Command

Action

at

Execute commands later.

atq

Show jobs queued by at.

atrm

Remove job queued by at.

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.

free

Show free and used memory.

hostname

Display the system's hostname.

kill

Terminate a running command.

printenv

Show environment variables.

ps

Show processes.

quota

Display disk usage and limits.

stat

Display file or filesystem status.

stty

Set or display terminal settings.

top

Display tasks currently running.

tty

Display filename of the terminal connected to standard input.

uname

Display system information.

uptime

Show how long the system has been running.

vmstat

Show virtual memory statistics.

who

Show who is logged in.


1.6.12. Text Processing

Command

Action

col

Process control characters.

cut

Select columns for display.

emacs

Work environment with powerful text-editing capabilities.

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.

groff

Format troff input.

gs

Display PostScript or PDF file.

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.

tr

Translate (redefine) characters.

uniq

Find repeated or unique lines in a file.

vi

Visual text editor.

vim

Enhanced version of vi.


1.6.13. Miscellaneous

Command

Action

banner

Make posters from words.

bc

Arbitrary precision calculator.

cal

Display calendar.

clear

Clear the screen.

info

Get command information from the GNU hypertext reader.

man

Get information on a command.

nice

Reduce a job's priority.

nohup

Preserve a running job after logging out.

openvt

Run a program on the next available virtual terminal.

passwd

Set your login password.

script

Produce a transcript of your login session.

su

Become a different user, often the superuser.

sudo

Execute an authorized command as root or another user.

tee

Simultaneously store output in file and send to screen.

time

Time the execution of a command

wall

Send a message to all terminals.

whoami

Print the current user id.

xargs

Process many arguments in manageable portions.




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