Title: CS155: Unix and You Lecture 1
1CS155 Unix and YouLecture 1
2What is Unix?
- Unix is a multi-user operating system
user1 - Terminal
UNIX
user2 - remote
parsons.cs.colostate.edu 129.82.46.117
user3 - remote
3A Bit of History
- Unix was developed at Bell Labs in 1969
- Today, many incarnations of Unix exist
- Linux is a free and open source version of the
Unix operating system. - Most CS machines run Linux, but some machine run
Solaris.
4What does it do?
- Unix is an interface to the resources of a
computer - Some of Unixs jobs include
- Interfacing w/ hardware CPU, memory, harddrives,
peripherals - Managing Processes program execution, memory
allocation - Handling Communication with other machines, with
the user - Resource allocation dividing processing time
between the processes of users
5Logging In (and Out)
- Since Unix is multi-user, you must login to a
machine to use it. - ssh is a secure protocol for communication
between computers - ssh clients exist for Windows
- putty.exe a simple client
- SSH Secure Shell more advanced
6Logging In (and Out)
- What happens once Im in?
- A shell is opened
- A prompt is presented
- A shell helps you communicate with Unix
- The prompt allows you to give the OS commands
gt gt exit logout
7File System Basics
- The file system is a tree structure containing
files - Every file has a path that is its location
- e.g. /s/chopin/k/fac/boese/my_file
8Absolute and Relative Paths
- An absolute path is the path from the root
directory, / - A relative path is the path from the current
directory - . is a symbol for the current directory
- .. is a symbol for the parent directory
The absolute path to program is
/usr/local/bin/program If we were in /usr/bin the
relative path would be ../local/bin/program If we
were in /usr/local/bin it would be ./program
9Navigating the File System
- Navigating the file system is the first Unix
skill you will learn - Our first Unix commands pwd, ls, cd, more
- pwd print working directory
- ls list directory
- cd change directory
- more view a file
gt pwd /s/chopin/k/grad/nate gt cd /s gt pwd /s gt
ls bach chopin parsons preisner
10More Navigation
- Your home directory is where you are when you
login to a unix system - is a symbol for your home directory
- Options can modify behavior, for example
gt ls bach chopin parsons preisner gt ls
l total 8 drwxr-xr-x 3 root root 0 Jan 17
0302 bach drwxr-xr-x 4 root root 0 Jan 17
1544 chopin drwxr-xr-x 3 root root 0 Jan 17
1548 parsons drwxr-xr-x 3 root root 4096 May 27
2005 preisner
11The Structure of a Unix Command
- command option file
- Let us take ls as an example
- -l use a long listing format
- -S sort by file size
- -1 list one file per line
gt ls bach chopin parsons preisner gt ls
1 bach chopin parsons preisner gt ls chopin a k gt
ls l chopin total 8 drwxr-xr-x 5 root root 4096
Jan 17 0201 a drwxr-xr-x 5 root root 4096 Jan
17 0216 k