GarnetChaney.com

Search:      

New and Improved! With More Quotations and Comments from my Readers!
| What Do You Want To Say Today? Chat at Chat11 || Health || Phobias || Sleep |

Articles:

Guides

Free Tools From Garnet

Resources

My Humor




                      ----> UNIX Guide II <----
                            --> Rev. 5 <--

Chris Alfeld - calfeld@east.slc.k12.ut.us

Legal Guck:
        You are free to distribute this guide unmodified in any non-profit way.
If you would like to modify it, or distribute it for a profit (CD-ROM, etc..).
Please ask me (address above).

Archives:
        ftp://ftp.east.slc.k12.ut.us/calfeld/
        http://www.math.utah.edu/creations/
        gopher://gopher.east.slc.k12.ut.us/1/Guides/

----------------------------------------------------------------------

- This Guide -
This guide is designed to apply to most BSD Unix systems.  It includes standard
commands, plus several useful and common commands.

- Notes -
Mail programs:  Almost all unix systems have 'mail' but most have replaced it
                with something.  As such I will not have any mail programs.

Compilers:      Compilers are not used by the common unix user, and if you
                know how to program you won't need me to tell you how to
                access the compilers.

Shell:          I do not say anything about  pipeing, redirection, or any other
                shell uses of programs (don't worry if you don't understand
                this)

- Format -
All command description will be in this format.

<Command name> - <short description>
        Syntax: <command syntax>
        <Long description>
        Useful Flags:
                <flags>

- Syntax -
Anything surrounded by <> (i.e. <file>) is a variable expression (it should
be replaced with something).

Anything surrounded by [] (i.e. [<file>]) is optional (you don't need to have
it to work).

These are only for common uses.  Almost all commands can be used with no
arguments.

- Contents -
1. The File System.
        A: Manipulating Files/Directories
        B: Displaying Files
        C: Editing Files

2. The Internet.
        A: Files
        B: Reaching out

3. System.
        A: Getting info on the system.
        B: Getting help
        C: Manipulating the system.

- The Commands -
1. the File System

A. Manipulating Files and Directories

cd - change directory
        Syntax: cd [<directory>]
        cd will change your current directory to a directory specified in
        the command argument.  <directory> can be absolute (cd /var), or
        relative (cd notes).  <directory> can also use the '~' character either
        to change to your home directory (cd ~) or someone else home directory
        (cd ~<user>).  cd with no arguments will change to your home
        directory and is identical in function to 'cd ~'.

ls - list directory contents
        Syntax: ls [flags] [<director(y/ies)/file(s)>]
        ls will list the contents of a directory.  ls by itself will list
        the current directory.  You can specify a list of a directories and/or
        files to list as well as several flags to control how the display
        appears.  Wild cards can be used.  Common wild cards are:
                * - match anything 0 or more characters long
                ? - match one character
                [x-y] - match any 1 character between x and y (i.e. [a-z]
                [abc] - match abs (i.e. [agh]) (can be longed then 3
                                i.e. [abdteh])
                [combination of above] - i.e. [adeA-Zhu-z]
        Common Flags:
                -a - list all files including ., .. and all those beginning
                     with a '.' (Files beginning with a . are normally not
                     shown).
                -s - show size of files
                -l - show owner, permissions, size, group, etc.. of file
                -C - show in columns
                -F - append * to executables, / to directories, @ for links,
                     etc.
                -t - sort in reverse order by time.

mkdir - Make a directory.
        Syntax: mkdir <director(ies)>
        mkdir will make 1 or more directories.

rmdir - Removes a directory.
        Syntax: rmdir <director(ies)>

rm - Remove files.
        Syntax: rm [<flags>] <file(s)>
        rm main purpose is to remove files.  It will also take flags that will
        allow it to remove directories.  Wild cards are allowed as well.
        Common Flags:
                -r - remove listed files and directories plus all files in
                     those directories plus all sub-dirs and there files in
                     listed directories, etc..
                -f - don't ask if you want to remove a file.
                -i - ask before removing a file.

cp - copy files
        Syntax: cp [-r] <original(s)> <new file or directory>
        cp will copy one or more files either to a new file or into a
        directory.  All command line elements not not beginning with a -
        except the last one are the files to be copied, and the last element
        is where or what to copy them to.
        Flag:
                -r - copy directories as well as files

mv - move files
        Syntax: mv <original(s)> <directory/file>
                mv <original> < new name >
        This is basically the same as cp only it does not leave a copy of
        the file, does not need the -r flag for directories and is a lot
        faster then cp.

ln - Make a link to a file.
        Syntax: ln -s <original> <link>
        Linking is to some a hard concept.  Mac System 7 users will do best
        thinking of a link as an alias.  Basically a link creates a file that
        points to the other file specified.  So if you edit the link unix
        edits the file, etc... The -s flag is almost always used.  What
        happens when it is not used is too complicated to put into this guide.

file - display what type of file a file is.
        Syntax: file <file(s)>
        file displays guesses at what a file is.

B. Displaying Files

cat - basic file display command
        Syntax: cat <file(s)>
        cat simply displays the files to the screen without pause.

more, page - Display file one page at a time.
        Syntax: page <file(s)>
        page and more are nearly identical programs that display a file one
        page at a time.  Both function basically by using space bar to go
        forward one page and return to go forward one line.

less - Display a file one page at a time with backwards and forwards movement.
        Syntax: less <file(s)>
        less is much like page.  The main difference is that you can go
        back one line or forward one line with a single key allowing easy
        scrolling.  To get help on less type 'h' while running it.

C. Editing Files

vi - File Editor
        Syntax: vi <file>
        I dislike vi so won't do anything here except to mention that it exists
        and that it is on almost all systems.

emacs - Powerful file editor and more
        Syntax: emacs [<options>] [<file>]
        emacs is far too complicated for me to explain here.   It is an
        incredible file editor, a lisp compiler, and far more.  To learn the
        basics of emacs type 'control-h t' to enter the tutorial.
        emacs can be extited with ^X^C (control-X control-C)

pico - simple text editor
        Syntax: pico <file>
        pico is a simple text editor that is fast loading and very easy to use.
        This is a good choice for quickly editing files, etc...


2. The Internet

A. Files

archie - search FTP archive for files.
        Syntax: archie [<flags>] <expression>
        Archie searches many ftp sites around the world for a file that matches
        <expression> according the flags it was given.  It then displays the
        result of the search to the screen or to a file.
        Common Flags:
                -s : Substring search
                -e : Exact search (default)
                -l : Show one find per line
                -c : Case-sensitive Substring search.
                -t : sort results by date.
                -o <file> : output to file <file>

ncftp - Enhanced ftp interface.
        Syntax: ncftp [<flags>] [<host>]
        ncftp is an enhanced version of ftp (see below) that may not be
        available on all systems.  Basic operation is the same as ftp but
        it shows the path at all times, shows file transfer progress, and
        has some nice commands like page.
        Common Flags:
                -u : ask for user name and password.
                -a : user name is 'anonymous', password is your email address
                        (default)
                -r : retry if connection fails.
                -d <seconds> : delay <seconds> between retries
                -g <tries> : give up after <tries> tries.

ftp - Basic ftp interface.
        Syntax: ftp [<host>]
        ftp is the standard way to use ftp.  If your system has it ncftp is a
        far better choice (see above).

B. Reaching out

gopher - Menu based information retrieval system.
        Syntax: gopher [<host>]
        gopher is the standard client for Gopher-Space, a network of 'gopher
        servers' that works based on menus.  This is a simple way to get
        information, just choose the item you want from the menu.  It will
        either show you another menu, display the file, etc...

lynx - World Wide Web hyper-text client.
        Syntax: lynx
        lynx is a text based client for the World Wide Web.  Basically you see
        a text file with some words outlined.  You can use the tab key to
        select these words and press returns.  This will show you another file
        .  If you have X windows try xmosaic.

talk, ytalk - User to user chat.
        Syntax: talk <user>[@<host>] [<tty>]
        talk will launch a two-window interface that allows real-time chatting
        between two users.  Ytalk allows chatting between multiple users and
        has some nice options you can access by pressing the escape key.

telnet, rlogin - Connect to a remote computer.
        Syntax: telnet <host>
                rlogin [-l <user-name>] <host>
        telnet and rlogin both allow you to connect to a remote computer.  The
        major differences are that rlogin does not ask you for a user name and
        checks a .rhosts file (don't worry about this if you don't understand).
        And telnet allows you to have some control over your connection by
        typing control-].

tin, rn, etc... - Usenet news readers.
        Syntax: varies
        These are all news readers, there are so many of them and I am not
        familiar with all of them so I will not put specific information on
        them in here.  Basically they allow you to choose from several
        thousand subjects and then read and/or post messages that anyone can
        read.  Those famailer with BBSs will recognize this as message boards.

finger - Find out information on about a user or a machine.
        Syntax: finger -l <user>[@<host>]
                finger @<host>
        finger -l will show you information about a user.  Last login, shell,
        etc.. finger @<host> will show you who is on that host or network.

3. System.

A. Getting info on the system.

ps - Find out what processes are running on the current machine.
        Syntax: ps [<flags>]
        ps will show a list of all or some processes running on the machine and
        some information about them.  Default shows your processes.
        Common flags:
                -a : show all user (vs. system) processes.
                -x : show all user and system processes.
                -u : show which user is running a process and other extra
                     information.

w - Show who is on the system and what they are doing.
        Syntax: w
        This will show you everyone on the system, what tty they are on,
        where they logged on from, when they logged on, how long they have been
        idle, how much CPU they are using total, and how much CPU there
        foreground process is using (see fg, and bg).

who - Show who is on the system
        Syntax: who
        This will simply show who is logged on, what tty they are on, when
        they logged on and where they logged on from.

last - Shows a log of connections.
        Syntax: last [<name>] [<tty>] [-<number>]
        If you specifically a login name then the log will display connections
        by that user.  If you specify a tty then it will show the connections
        for that tty (the tty is what port the user linked up to).  If you
        specify a - and a number it will only show that many entries of the
        log.

lpq - shows files to be printed.
        Syntax: lpq
        lpq will display what files are waiting to be printed and what file
        is currently being printed.

whoami - Shows your login name.
        Syntax: whoami
        Simply displays your login name.

B. Getting help

man - access manual pages.
        Syntax: man [<section>] <command>
                man -k <keyword>
        man access a very large online help database and will probably
        be your main source of reference.  The manual pages are divided
        into several sections (1 user commands,2 system calls, etc..).
        If you do not signify a section it will search through all
        sections starting at 1 until it find the command you want.  man -k
        allows you to specify a keyword and it will search for that keyword
        and display a one line summary on all commands that have to do with
        that keyword.

C. Manipulating the system

lock - Locks you terminal
        Syntax: lock
        lock prompts you for a password and after verifying it will not allow
        access to your terminal until the password is typed in.

logout - Logs you out of the system.
        Syntax: logout
        Logout will log you out of a system.  If it does not work try exit
        instead.

exit - exits the shell.
        Syntax: exit
        Exit differs from logout in that if you are already logged in (like on
        a X station) some interfaces will only start a shell (xterm) instead
        of logging in again.

print,lpr - Prints a file.
        Syntax: print [<flags>] <file>
        Print and lpr both print a file.  Both take a variety of flags, etc.
        The most basic operation is to type print or lpr and the name of a
        file.  Common flags for lpr are:
                -h : print no header.
                -P<printer> : print to printer <printer>.
                -#<number> : print <number> copies.

passwd - Will allow you to change your password.
        Syntax: passwd
        passwd simply prompts you for your current password, ask you for a new
        password, asks you to verify the new password and then changes your
        password.

write - Will display some text on another users screen.
        Syntax: write <user> [<tty>]
        After typing this command it will no longer show the
        prompt.  Anything you type now not beginning with a ! will be sent
        to the other person.  You can exit this by typing control-d. If you
        begin a line with a ! then that line is interpreted as a command.


- So ends UnixGuide II -

www.GarnetChaney.com

My Unix Books List



Unix in a Nutshell: A Desktop Quick Reference for SVR4 and Solaris 7
(3rd Edition)
by by Arnold Robbins


Unix Shell Programming, Third Edition
by by Stephen Kochan


Practical Unix & Internet Security, 3rd Edition
by by Simson Garfinkel


Linux for Windows Administrators
(Mark Minasi Windows Administrator Library)
by by Mark Minasi


Advanced DBA Certification Guide and Reference for DB2 UDB v8 for Linux, Unix and Windows
by by Dwaine Snow

Copyright (C) 2003 by www.GarnetChaney.com
Get your Amazon List at GarnetChaney.com

www.GarnetChaney.com

Good Unix Books

Advanced DBA Certification Guide and Reference for DB2 UDB v8 for Linux, Unix and Windows
by Dwaine Snow Synopsis
Everybody who has passed the Fundementals DBA exam should want this book to prepare for the Advanced DBA exam. The accompanying CD-ROM includes a trial version of DB2, a sample exam and study questions.

From the Back Cover

    * Definitive preparation for Exam 704: DB2 UDB V8.1 Advanced Database Administration for Linux, UNIX, and Windows, which leads to an IBM Certified Advanced Database Administrator certification * Database design, performance monitoring and tuning, scaling for terabytes of data, high availability, enterprise-level security, and more * The appendices contain sample certification exam questions and answers

Whether you're a long-time DB2 UDB professional or an experienced DBA who's migrated from another database platform, there's one sure way to demonstrate the highest level of skills in DB2 database administration: pass the challenging IBM DB2 Universal Database Advanced Database Administration Exam.

Now, there's a definitive guide to advanced DB2 UDB database administration that also delivers all the depth and insight you need to prepare for the tough new IBM exam. Straight from the DB2 experts at IBM, this book offers systematic and authoritative coverage of every exam objective and will serve as a reference after you have passed the test.

For the first time, this book brings together IBM best practices, techniques, tips, guidelines, and rules of thumb for virtually every aspect of advanced DB2 UDB v8 database administration.including all this and more:

* Ability to design, create, and manage table spaces
* Ability to design, create, and manage buffer pools
* When and how to exploit parallelism in DB2 UDB
* Configuring federated database access
* Designing and implementing a backup and recovery strategy
* Ability to implement a standby database
* Monitoring and tuning DB2
* Using and managing tables using multidimensional clustering
* Designing and configuring multiple database partitions
* Implementing authentication and encryption on a large scale
* Leveraging parallelism and symmetric multiprocessing
* Preparing for and executing recovery in an enterprise environment
* Rapid recovery in the event of table space or table level disasters
* Effective monitoring and problem determination
* Maximizing performance and scalability

About the CD-ROM

The accompanying CD-ROM contains the IBM DB2 Universal DatabaseEnterprise Server Edition Version 8.1, for Windows Operating Environments,Evaluation Copy, plus DB2 UDB v8 Enterprise Server Edition documentation inPDF format.

About the Author
DWAINE R. SNOW has twelve years of experience implementing and tuning DB2 to supportworkloads from Web-based transactions up to multiterabyte data warehouses. Snow is theproduct manager for DB2 partitioned databases and is co-author of The DB2 ClusterCertification Guide.

THOMAS X. PHAN is an IBM Certified I/T Specialist in the IBM DataManagement Consulting practice with over thirteen years of data processing experience. Hespecializes in relational database-related services including application design, logicaland physical database design, and performance and tuning on numerous DB2 platforms.

 

Search:      

Garnet R. Chaney's Blog

Other interesting links:

Visit MySleepCenter to learn about a better night's sleep.
Visit MyWebLegalCenter when you need legal help.

Search the net for guide unix user

Please link to us!
Garnet Chaney says "No information found at my web sites can replace a personal meeting with your physician about your health. Please don't just rely on the internet for your first opinion, but also seek professional help for any serious problem."

Copyright 2001-2004 By GarnetChaney.com. All Rights Reserved.

This Site Produced With SiteMaker Web Design Tool.