(rlogin):
echo $DISPLAYThis may produce output like this:
local_machine:0.windowor
local_machine:0If not, look in your command line prompt or try the following command
hostname(2) give the remote machine permission to use your display:
xhost remote_machine(3) Remotely login to the remote machine
rlogin remote_machine -l your_user_nameor the more secure version:
slogin remote_machine -l your_user_name(4) On the remote machine... tell it your display
DISPLAY=local_machine:0; export DISPLAY
O'Reilly 1.01, 1.02 is essential reading.
UNIX is designed for power users, not novices. Their are lots of small but powerful programs that can be easily connected up to solve complex problems [ O'Reilly 1.03..1.07]
You are probably using a shell called the Bourne Again SHell or bash. It aims to have all the features of the C shell, the Bourne shell (sh)(by Steve Bourne) and the Korn shell created by David Korn( ksh). bash combines the best features of the shells in the book. [ O'Reilly 1.08..1.09]. For more on the Korn Shell see [ http://www.kornshell.com/~dgk/ ] (Thanks to Heiner Steven heiner.steven@odn.de for correcting these notes).
All our workstations and almost all the servers at CSci.CSUSB.EDU share the same accounts. The account information is served by the NIS or YP(Yellow pages) servers. So use 'ypcat passwd' not 'cat /etc/passwd'.
The passwd file is public knowledge because (1) passwords are encrypted, and (2) we chose our passwords so that they can not be guessed, and (3) we change them often enough that by the time some one has cracked one, we've changed it anyway.
You can see your PATH by inputting the internal command
echo $PATH[O'Reilly 1.10].
When you type an external command, your shell goes to sleep while UNIX executes a command and wakes up when it is finished[O'Reilly 1.10, 1.13].
All programs can be commands. Most commands are the name of a program. The shells are programs that read commands. Therefore you can enter another shell by typing its name as a command, and your old shell waits until you've finished sending commands to the new shell.
Scripts are files that can be read and executed by shells or other programs[O'Reilly 1.12].
UNIX systems are always busily running dozens of processes -- and you don't know about most of them.
(kernel):
The kernel is the heart of UNIX.[1.14]
The kernel hides the hardware from the user[1.14].
The kernel protects the user from knowing the bits, bytes, and SCSI little details[1.14].
It also protects data from unwanted intrusions.[1.23]
Programs can't "get around" the kernel.
Most of the time you forget that the kernel exists.
(case):
UNIX is CaSe SeNsItIvE.[1.15]
(rm):
Once a file is removed its storage is instantly recycled for someone else to
use. It is often scrambled for security reasons as well. Hence a removed
a file is gone forever.[1.15]
Some characters have a special meaning to a UNIX shell and are removed or replaced before a command is executed by the shell. [1.16]
Shell punctuators: ; & && | || () [] {} and newline. [ Syntax ]
UNIX file systems are a directed graph, not just a tree. However there is a single top level directory from which all others are found - the root "/"[1.19].
A disk drive can be anywhere on the network.... so you do not refer to disk drives when you want to name a file.
Directories are files that describe where other files can be found. A path follows from directory to directory.
When you login you are working "in" your "home directory". At any time you have a current working directory or CWD
The kernel hides the physical structure of the file system (Inodes)[1.22]
The kernel hides the data in some files and directories from some users[1.23,1.25], but the superuser can see anything every where[1.24]. Hence only one or two people should ever have access to the superuser account.
Lots of people use a UNIX machine at one time... even when they are not logged in[1.26,1.27]
We have the abillity to run programs in the background[1.27]. Look out for the gotchas[1.28].
UNIX makes everything look like a file[1.29]. Your terminal looks like a pair of files as well! You can redirect output(>) from your terminal to a file, or redirect input(<) so that it is taken from a file rather than your terminal[1.30].
We run XWindows[1.31].
We are on the Internet and we have mail, ftp, uucp, usenet, rlogin. rcp, rsh, NFS, write, talk, ...[1.33]
UNIX is not perfect[1.34]. You have my permission to "let of steam" (but politely) on the BBS. There are things in UNIX that still drive me wild... but I keep my flames clean! I also accept that your feelings may not match mine.
You learn UNIX by doing as well as by reading. See the Exercises.
For all relative_path_name P, ./P means the same thing as P.
Exercises
Type in the following carefully and see what they do (CTRL/D means hold down the CTRL key and tap the D key):
cal 1996
cal
cal >month
cat month
date
who
finger
cat >mine
Pack my box with five dozen liquor jugs!
CTRL/D
cat m????
cat >a2A
tr 'a' 'A'
CTRL/D
chmod +x a2A
a2A <mine
a2A <month
sed "s/ my / your /" <mine >yours
cat yours
See also
The CS FAQ booklet
[ CS_FAQ.html ]
Study the syllabus, schedule and other information forthis class: [ syllabus.html ] [ syllabus.html ] and [ schedule.html ] [ schedule.html ]
Browse through the WWW pages for this class. Login to your favorite machine in the CS dept and use mosaic, netscape, or lynx(which ever works and you like) to look at http://www/dick/cs360. From a non-CS lab, the IBM PC Lab, AOL, or another ISP point their WWW server at http://www.csci.csusb.edu/cs360
O'Reilly: chapter 1, p39(intro to part one)
Questions
Once your command procedure (proc) has been made, How do you run it?
grep '[Ww]hich' chapter1 |morethe command 'more':
cat files|grep .XX|sort -u|more
Who is the Bourne $shell user below:
star.trek.z
Next
Logging in
[ 02.login.html ]
[ 02.login.html ]
, logging out
[ 03.logout.html ]
[ 03.logout.html ]
, and simple security
[ passwords.html ]
[ passwords.html ]
. . . . . . . . . ( end of section Introduction to CS360 and UNIX Tools) <<Contents | End>>
Submit Your Notes Here
To earn credit for completing this part of the course
you need to send me a short list of things you have learned.
A simple way to do this is to
follow this
[click here
if you can fill this hole]
link and fill in the form using copy and paste.