Você está na página 1de 29

Intro.

to Linux OS
CSE882- Computing for CSE
Lecture 1
Sep 09, 2015

A Simple Definition of OS
A complex layer of software between
applications and the computer hardware
An operating system (OS) is a computer program
that manages the hardware and software
resources of a computer (wikipedia)
Applications like Internet Explorer

Operating System

Computer Hardware

Structure of the UNIX


System
There are many
standard
applications:
file system
commands
text editors
compilers
text processing

Linus and Linux


Linus Trovalds is the
guy who wrote Linux
when he was a student
in Finland:
Evolved out of Minix

He is the ultimate
authority of Linux OS:
Current estimates
suggest that he has 2%
contribution to Linux
4

Some Linux Distributions

Red Hat Fedora Linux


Debian
Gentoo
SuSE
Slackware
Ubuntu
Knoppix
Many more
5

Fundamental differences (Windows vs.


Linux)
Full access vs. no access
Licensing freedom vs. licensing restrictions
Online peer support vs. paid help-desk
support
Full vs. partial hardware support
Command line vs. no command line
Centralized vs. no centralized application
installation

http
://www.techrepublic.com/blog/10things/10-fundamental-differences-betw
een-linux-and-windows/
6

Putty SSH Client

WinSCP

WinSCP

Authenticating

WinSCP

Outline
Review of UNIX Concepts and Commands
Introduction to UNIX
Major components of UNIX
The file system (directory hierarchy, fstypes)
Listing directories (ls pwd command)
Creating files (touching files, vi editor)
Displaying files (cat, more, less, head, tail, file, which)
Moving around directories (cd, mkdir)
Piping ( | ) and redirection ( >, <, >>, <<)
Searching for a pattern (grep, egrep)
Finding files (find command)
Cut and paste (cp, mv, rm, cut, paste)
10/6/15

12

12

The UNIX OS

The UNIX operating system was developed


originally at AT&T Bell Laboratories in 1969
It was created as a tool set by programmers
for programmers
The early source code was made available
to universities all over the country
The evolution of Unix Time-Sharing System
(Recommended Reading):
http
://pdos.csail.mit.edu/6.828/2010/readings/ritchi
e79evolution.html
10/6/15

13

13

Outline
Review of UNIX Concepts and Commands
Introduction to UNIX
Major components of UNIX
The file system (directory hierarchy, fstypes)
Listing directories (ls pwd command)
Creating files (touching files, vi editor)
Displaying files (cat, more, less, head, tail, file, which)
Moving around directories (cd, mkdir)
Piping ( | ) and redirection ( >, <, >>, <<)
Searching for a pattern (grep, egrep)
Finding files (find command)
Cut and paste (cp, mv, rm, cut, paste)
10/6/15

14

14

Computer Hardware Components


A computer consists of hardware and software that
work together to perform tasks.
The computer hardware is made up of several
components, such as the central processing unit
(CPU), random access memory (RAM), and disks.
Computer software refers to a set
of programs or applications that run
the computer.
The operating system is a set of
programs and files that directs and
controls both the hardware and
the software.
15

15

Components of UNIX OS
This section introduces three
components of UNIX:
The kernel
The shell
The directory hierarchy

10/6/15

16

16

Kernel
The kernel is the core of the operating
system. The image shows the kernel,
which manages all the physical
resources of the computer, including:
File systems and structures
Device management, such as
storing data to the hard disk
Process management or CPU
functions
Memory management
10/6/15

17

17

Shell

The image shows the shell as an


interface between the user and the
kernel.
The shell is primarily a command
interpreter. The shell accepts the
commands that a user enters,
interprets these
commands, and passes them
to the kernel.
The kernel executes the
10/6/15

18

18

Directory Hierarchy

init.d

etc

rc.d
bin
include

usr

lib

sbin
home

hamm
ad

var

umar

bin

wahab

sbin
10/6/15

19

19

Outline
Review of UNIX Concepts and Commands
Introduction to UNIX
Major components of UNIX
The file system (directory hierarchy, fstypes)
Listing directories (ls pwd command)
Creating files (touching files, vi editor)
Displaying files (cat, more, less, head, tail, file, which)
Moving around directories (cd, mkdir)
Piping ( | ) and redirection ( >, <, >>, <<)
Searching for a pattern (grep, egrep)
Finding files (find command)
Cut and paste (cp, mv, rm, cut, paste)
10/6/15

20

20

Listing Directory
The prompt of a shell terminal contains the
current directory.
The tilde ~ indicates that you are in the user's
home directory
You can use the following commands to list the
contents of a directory and list the current
working directory:
ls
pwd

10/6/15

21

21

ls

The command ls (list) lists the specified files


If a directory is included with ls, the directory's
contents are displayed
Without any option, the contents of the current
directory are listed

10/6/15

22

22

ls command

Try using following:


lsa
lsl
lsalR

10/6/15

23

23

pwd command

You can use the command pwd (print


working directory) to display the path
of the current directory.

10/6/15

24

24

Outline
Review of UNIX Concepts and Commands
Introduction to UNIX
Major components of UNIX
The file system (directory hierarchy, fstypes)
Listing directories (ls pwd command)
Creating files (touching files, vi editor)
Displaying files (cat, more, less, head, tail, file, which)
Moving around directories (cd, mkdir)
Piping ( | ) and redirection ( >, <, >>, <<)
Searching for a pattern (grep, egrep)
Finding files (find command)
Cut and paste (cp, mv, rm, cut, paste)
10/6/15

25

25

Create a New File with touch


You can use the command touch to
change the time stamp of a file or
create a new file with a size of 0 bytes.
Try: touchnew_file

10/6/15

26

26

Starting vi
vi editor can be started by issuing
command vi at the command line
followed by some options then filename
vioptionsfilename
If a file does not
yet exist,
it is created.

10/6/15

27

27

Using vi

There are three types if available


modes in vi that are:
Command mode
Insert mode
Command line mode

More details:
http://blog.interlinked.org/tutorials/vim_tuto
rial.html

10/6/15

28

28

Exercise
Write a file with the following
contents using the vim editor on a
UNIX system:
/* Hello World program */
#include<stdio.h>
main() {
printf("Hello World");
}

29

Você também pode gostar