Docsity

CS 344: UNIX OS Fundamentals - Lecture 1 by Purushotham Bangalore, Study notes of Computer Science

Toggle sidebar
bg1
CS 344 – UNIX OS
Fundamentals – Lecture #1
Purushotham Bangalore
Department of Computer and Information
Sciences
University of Alabama at Birmingham (UAB)
1/24/2005 2
Operating System
• Acts as an interface between the user and
the computer hardware
• A program that controls the execution of
other programs
• Responsible for managing different
computer resources (CPU, memory, disk,
display, keyboard, etc.)
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download CS 344: UNIX OS Fundamentals - Lecture 1 by Purushotham Bangalore and more Study notes Computer Science in PDF only on Docsity!

CS 344 – UNIX OS

Fundamentals – Lecture

Purushotham Bangalore Department of Computer and Information Sciences University of Alabama at Birmingham (UAB)

Operating System

• Acts as an interface between the user and

the computer hardware

• A program that controls the execution of

other programs

• Responsible for managing different

computer resources (CPU, memory, disk,

display, keyboard, etc.)

1/24/2005 3

UNIX OS

Hardware

Kernel

Shell, editors, etc.

Compiler components

Compiler

Other utilities

Desktops vs. Servers

  • Desktops • Servers

Program

Client

Client Internet Server

Server

1/24/2005 7

  1. Press ENTER key, another pop-up window will appear
  2. Enter the hostname and username
  3. Click on “Connect” button

Click on Yes

1/24/2005 9

Enter password

Now you are ready to enter commands at the UNIX Shell prompt

1/24/2005 13

Sample Commands

• Identifying current directory

  • pwd

• Listing files

  • ls

• Passing arguments

  • Long listing: ls -l

• Listing processes

  • ps
  • ps –u
  • ps -ef

Simple Operations with Files

• View Files with more

  • search for a string – /n
  • move forward and backwards – n and b

• Other options to view files – cat, head, tail

• Count lines, words, characters – wc

• Copy files – cp

• Rename files – mv

• Remove files – rm

• Sorting contents of a file – sort

• Locate specific lines in a file – grep

1/24/2005 15

Redirecting Output

  • By default output from a utility is sent to the terminal/screen
  • Output can be redirected to a file or another utility
  • The “>” symbol tells the shell to open a new file and send the output to that file - ls -l > myfiles
  • The “|” symbol tells the shell to connect the output of the first process to the input of the second process - ls –l | wc –l - Two processes are created for each of the commands and the output of the first process is sent to the input of the second process

Redirecting Output

out Screen Utility: ls Args: -l

out Utility: ls Args: -l File: myfiles

out Utility: ls Args: -l

out Utility: wc Args: -l

in (^) Screen

Command: ls -l Command: ls –l > myfiles

Command: ls –l | wc -l

out

Utility

in err