DAY 2 COP 3502 Fall term 2004
UNIX Versions NAMESupplier Based on AIXIBM AT&T System V A/UX Apple Computer AT&T System V DynixSequentBSD HP-UXHewlett-PackardBSD Irix Silicon Graphics AT&T System V Linux Free Software Foundation NextStepNextBSD OSF/1DECBSD SCO UNIX Santa Cruz Operation AT&T System V Solaris Sun Microsystems AT&T System V SunOS Sun Microsystems BSD Unix UltrixDEC UnicosCray AT&T System V Unix Ware Novell AT&T System V XenixMicrosoft
The UNIX Shell Bourne Shell- In the near beginning there was the Bourne shell /bin/sh (written by S. R. Bourne). It had (and still does) a very strong powerful syntactical language built into it, with all the features that are commonly considered to produce structured programs; it has particularly strong provisions for controlling input and output and in its expression matching facilities. But no matter how strong its input language is, it had one major drawback; it made nearly no concessions to the interactive user (the only real concession being the use of shell functions and these were only added later) and so there was a gap for something better.
The UNIX Shell C-Shell - Along came the people from UCB and the C-shell /bin/csh was born. Into this shell they put several concepts which were new, (the majority of these being job control and aliasing) and managed to produce a shell that was much better for interactive use. The new shell was simply too buggy to produce robust shell scripts and so everybody stayed with the Bourne shell for that, but it was considerably better for interactive use so changed to the C shell, this resulted in the stupid situation where people use a different shell for interactive work than for non- interactive, a situation which a large number of people still find themselves in today.
The UNIX Shell Korne Shell - Eventually David Korn from AT&T had the bright idea to sort out this mess and the Korn shell /bin/ksh made its appearance. This quite sensibly junked the C shells language and reverted back to the bourne shell language, but it also added in the many features that made the C shell good for interactive work (you could say it was the best of both worlds), on top of this, it also added a some features from other operating. The Korn shell became part of System V but had one major problem; unlike the rest of the UNIX shells it wasn't free, you had to pay AT&T for it.
The UNIX Shell TCSH - The T C-shell (tcsh) is a command interpreter that is similar to the C-shell (csh). The syntax for writing scripts in the tcsh is the same as for the csh. Unlike the csh, this shell is not available on every Unix system. However, it is available on Sun, SGI, and HP workstations. The tcsh shell is the default when you log on to a Linux Intel system. The location for tcsh varies between the architectures. It is the default Department of Computer Science shell for all new users.
Files in your directory .login – A shell script that is run after.tcshrc and sets up your environment and path names. Leave it alone. (csh only) .tcshrc – Specific to the tcsh shell, this runs startup scripts that set additional path names, terminals, database connections. Leave it alone for right now. .plan – Place to put personal information. Can be seen by using the “finger” command which is disabled in our department. .forward – If you are using UNIX mail, placing an address ( or more ) will have your forwarded to that address. .profile – Commands to be run when you log in (sh & ksh only) .xinitrc – Commands to configure X Window System .mwmrc – Commands to configure the Motif Window Manager .logout – Commands to run when you log out (csh only ) ,. - Dot Dot file is the location of the root directory of where you are currently positioned. . - Dot file has the lists of the lower directories.
Standard Environment Variables VariableContents Home Pathname of your home directory Path Directories where shell is to look for commands and files Term The termcap code for your terminal User Your user namae Pwd Working directory Mail Pathname of your system mail box Shell Pathname for your shell To see environment variables enter: setenv
Standard Environment Variables USER=gaitrosd LOGNAME=gaitrosd HOME=/home/faculty/gaitrosd PATH=/home/faculty/gaitrosd/.bin:/home/faculty/gaitrosd/.scripts:/usr/local/bin:/usr/l ocal/jdk1.2.2/bin:/usr/lang:/bin:/usr/bin:/usr/ucb:/usr/local/gnat/bin:/usr/etc:/usr/local/ bin/X11:/usr/bin/X11:/usr/openwin/bin:/usr/ccs/bin:/usr/sbin:. MAIL=/var/mail//gaitrosd SHELL=/bin/tcsh TZ=US/Eastern SSH_TTY=/dev/pts/25 TERM=vt100 DISPLAY=localhost:43.0 HOSTTYPE=sun4 VENDOR=sun OSTYPE=solaris MACHTYPE=sparc SHLVL=1 PWD=/home/faculty/gaitrosd GROUP=fac HOST=diablo REMOTEHOST=staffpc8.cs.fsu.edu MACHINE=diablo CLASSPATH=.:/usr/include/java/classes:/home/courses/cop4710/classes MANPATH=/usr/man:/usr/local/man:/opt/SUNWspro/man EDITOR=pico LD_LIBRARY_PATH=/usr/lib:/usr/local/lib OPENWINHOME=/usr/openwin NNTPSERVER=news.fsu.edu DOMAINNAME=cs.fsu.edu ORGANIZATION=FSU Computer Science Department
Login From home you need to be running ssh ( Secure Shell) See for download instructions and license agreement. You must be connected to a campus computer in order to get this. See for download instructions and license agreement. You must be connected to a campus computer in order to get this. Once you have the SSH program you can install it on any machine. Once you have the SSH program you can install it on any machine. See demonstration of ssh. See demonstration of ssh.
Login At the Login screen enter your user name. Remember that UNIX is case sensitive. Remember that UNIX is case sensitive. Once the username is accepted, enter the password. Be careful not to make a mistake. Most of the time, backspace will not work. Once the username is accepted, enter the password. Be careful not to make a mistake. Most of the time, backspace will not work. You should be at the opening prompt. To make sure you are at your home directory, enter the change directory command cd ~username (Where username is your account name and is the return key. cd ~username (Where username is your account name and is the return key. Example cd ~gaitrosd Example cd ~gaitrosd
Logout To logout of the system you can enter either logout logout exit exit
Changing your password Command: passwd Description: Asks you to type in a new password. You can only do this for you own account. Sample: passwd Note: The command will then prompt you to enter you old password and the new one twice. The new one must consist of a minimum number of characters one of which has to be an upper case letter, one has to be a digit, and one has to be a special character.
Directories and File Names Directories are basically a special kind of file that contains the names of other files and directors. Some OS call them folders. At any given moment you have a current directory When you first login you are placed in your home directory ~ ( tilde ) is the shorthand for your home directory. As with filenames, you can use upper and lower case letters, digits, periods, and underscores in directory names.
Filenames Filenames can user upper and lower case letters, digits, periods and underscores. Filenames are case sensitive Do not use odd characters in filenames and don't use spaces.
Pine See demonstration in class See help on Pine from the ACNS web pages at: HOMEWORK: - Login with your account - Change your password - me at with your CS mail account from pine and tell me you have changed your password. - Be sure and make the subject PASSWORD CHANGED
Another Useful Feature Standard input-output redirection There are times we would like to take the standard output that goes to the screen and place it in a file. We can do this with the ">" symbol. Let us say we want to put the list of a directory in a file. There are times we would like to take the standard output that goes to the screen and place it in a file. We can do this with the ">" symbol. Let us say we want to put the list of a directory in a file. SEE DEMONSTRATION SEE DEMONSTRATION
Another Useful Feature Standard input-output redirection Also, there are times when we want input usually coming from the keyboard to come from a file. This is done with the "<" symbol. Also, there are times when we want input usually coming from the keyboard to come from a file. This is done with the "<" symbol. DEMONSTRATION DEMONSTRATION