Intro to UNIX

Files

Long ago, before most of you were born there were computers. And they had very little memory and small and slow storage devices. RAM would cost millions for just a few kilobytes. There was lots of recycling and reuse. Keep that in mind, cause UNIX is old too and most everything about computers today have their roots in the past.

Now when storage devices were added, like harddrives or tapes, or output devices like monitors and printers a problem would occur in theory. How do you store information about these devices? What about adding a modem, suddenly you have to have a some way to access the modem. Now of course there are drivers, programs which basiclly run the hardware, but the question still remains, how does the software actully "access" the "monitor" or "printer"?

Now to keep things simple, the gods of way back said, "everything will be a file" that way to access the monitor you access a file, and the file is really the monitor. Because of this there are 3 basic types of files in UNIX. They are...

  • Ordinary - Just a normal file, wether it be an executable or text file for example.
  • Directory - AKA folders in Windows. These are files that contain information about other files
  • Special - These are the printers, monitors, ect.
    NOTE: Directories are not always considered a type of file. In which case there are ONLY ordinary and special files. For this class we will assume that there are TWO types of files.

    Loggin in

    We will cover loggin in in class since it wil be easier then trying to explain it. You will need to choose a password for your account. Choosing a password is important since you don't want others to use your account, and certinly the administration doesnt. So you need to choose a good password. What is a good password you ask? Well lets start with what is a bad password. Bad passwords are ones that people can easilly guess. Like your birthday 210276 or your wedding anniversary or anything else someone else knows.

    Good passwords are ones with mixed lower/upper case and non alpha-numberic characters. For example IwR&Ran. How can I remember such a mess of letter? I Wanna Rock & Roll All Night.

    Other Stuff

    So your online and doing stuff... you will soon notice that you can do many things at once and all will run at the same time. UNIX is multi-processing, menaing it can handle many processess. You can see what processes you are running by typing ps or ps -ux or ps ux depending on your operation system version. Information such as size, cpu intensity and Process ID number can all be seen.

    Now the information for the course is help in /home/215/ and whenever you want to get to that directory you will have to type cd /home/215. There is a shorter way to do that, you can create an alias which is really a short version of it. I can type alias c215 'cd /home/215'. That would create an alias so all I ever have to type is c215 and the computer will think I typed 'cd /home/215'. The alias will disappear after you log out. If you add the alias line to the end of your .cshrc file it will exist everytime you log in.

    So now you can have multiple users on the computer at the same time, since it can run multiple processess. And you call can create your own ordinary files. I of course don't want you to be able to read all my files, but I do of course want you to read some of them. So I need a command to grant file permissions. Lucky us there is a command chmod. There is another command as well called man which will access the manual pages. man is a very important command because it will give you help files for all the other commands. Type man chmod for information on the chmod command.

    Finally editing files. There are several editors on the system.

  • emacs : You should use this
  • pico : You can use this, but emacs is recommended.