190 likes | 317 Views
CSCI 243: C & UNIX. Kirk Anne South 124A kma@geneseo.edu. Man Pages. The “window’ to the UNIX world On-line documentation available Difficult at first, useful later. Basic “man page” Format. NAME SYNOPSIS DESCRIPTION OPTIONS EXAMPLES ENVIRONMENT SEE ALSO. “man page” sections.
E N D
CSCI 243: C & UNIX Kirk Anne South 124A kma@geneseo.edu
Man Pages • The “window’ to the UNIX world • On-line documentation available • Difficult at first, useful later
Basic “man page” Format • NAME • SYNOPSIS • DESCRIPTION • OPTIONS • EXAMPLES • ENVIRONMENT • SEE ALSO
“man page” sections • Section 1 - User Commands • Section 2 - System Calls • Section 3 - Library Calls • Section 4 - File Formats • Section 5 - Headers, Macros • Section 6 - Games/Demos • Section 7 - Devices • Section 8 - System Management Commands
Using “man” • man chown • man -s 2 chown or man 2 chown • man -k owner
Editors • Oh so many choices, so little time… • ed (worse than the cartoon) • vi (Not “vye”, it’s vee-eye [check the manual]) • emacs (Everything AND the kitchen sink) • pico (the easy way out)
Why “vi”? • It’s on every UNIX system. • If you do system adminstration, you will want to learn it. • “Moded” editor • After you learn it, it is a fast editor to work with.
Why “emacs”? • On many machines • If you do a lot of programming, you will want to learn it. • Multiple windows, multiple files • Invoke compilers, make and debuggers from within it. • Graphical interface
How to learn more • “emacs” - Chapter 7 of UNIX in a Nutshell • “emacs” - Control H t (tutorial) • “vi” Chapter 8 of UNIX in a Nutshell • “vi” “Introduction to ‘vi’”
File permissions • Major part of UNIX security • Three levels of permissions: • User (that’s you) • Group • Others • Use the “chmod” command to change permissions
r - read w - write x - execute (examine) s - set id t - “sticky bit” u - user g - group o - other a - all + add - remove Permission options
First 3 bits = user rwx Second 3 = group rwx Last 3 = other rwx 666 Write by all (bad) 755 644 umask ### sets the standing file permissions for files created. Uses the “mask” to set permissions 077 -> 700 027 -> 750 Octal Representation
“chmod” examples • chmod ugo+r file.c • chmod go-rwx directory • chmod 755 a.out • chmod u+rw,go-rw private
Processes • A “process” is a program that is in memory. • States: • Running • Stopped • Foreground • Background • Terminated
Commands • “ps” Process Status • “fg” Foreground • “bg” background • “jobs” Show jobs that are running • “kill” Terminate w/ extreme prejudice
X Windows • Graphical front-end to UNIX • Can have many different “window managers” • Common Desktop Environment (CDE) • OpenWindows • KDE • Gnome
Useful X commands • xterm • xhost • fvwm • twm • setenv DISPLAY machine-infront-of-you.edu:0 • -display tristan.cs.geneseo.edu:0.0
More information about X • AnswerBook in OpenWindows • The “Help” key • Man pages
More information... • http://cbt.geneseo.edu (Computer Based Training) • http://sunsite.unc.edu/mdw (Linux) • http://sunsolve.sun.com (Sun help) • http://www.cs.geneseo.edu/~kma