Learing outcomes Introduction to Unix system Unix commands.

Slides:



Advertisements
Similar presentations
Shell Script Assignment 1.
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
Chapter One The Essence of UNIX.
1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Exploring the UNIX File System and File Security
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
The Unix Shell. Operating System shell The shell is a command interpreter It forms the interface between a user and the operating system When you log.
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
CMPE 151: Network Administration Spring Class Description Focus: system and network administration. Sequence of exercises. E.g., installing/configuring.
UNIX Utilities Learning Objectives: 1. To understand the some basic utilities of UNIX File 2. To compare UNIX shell and popular shell 3. To learn Input/Output.
1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
7/17/2009 rwjBROOKDALE COMMUNITY COLLEGE1 Unix Comp-145 C HAPTER 2.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Basic Unix commands (vs. DOS) cat fileConcatenate or type out a file cat file1 file2... Type out a number of files cd directory1Change current directory.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
CPS120: Introduction to Computer Science Operating Systems Nell Dale John Lewis.
Unix Basics Chapter 4.
An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: n Date: Jan.29, 2001.
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
1 Operating Systems Lecture 2 UNIX and Shell Scripts.
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Intro to UNIX Presented by: Student Ambassadors: Lauren Lewis Martin Sung.
PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived.
Introduction to Programming Using C An Introduction to Operating Systems.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
Environment After log in into the system, a copy of the shell is given to the user Shell maintains an environment which is distinct from one user to another.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Files and Directories in UNIX The first file in UNIX file system is “root” or “/”
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
The Unix File sytem. Introduction Tree structure …
Learning Unix/Linux Based on slides from: Eric Bishop.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Overview of Linux Fall 2016 Dr. Donghyun Kim
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Linux 101 Training Module Linux Basics.
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
C151 Multi-User Operating Systems
INTRODUCTION TO UNIX: The Shell Command Interface
Unix : Introduction and Commands
Linux Shell Script Programming
Welcome to Linux Chap#1.
Chapter 3: The Shell.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Learing outcomes Introduction to Unix system Unix commands

What is a UNIX? UNIX is an operating system An operating system is the program that controls all the other parts of a computer system, both the hardware and software.

What is LINUX LINUX is a free UNIX-type operating system originally created by Linus Torlvads with the assistance of developers around the world. The source code for Linux is freely available to everyone. The commands of linux are similar to unix.

Features of UNIX UNIX is a multi-user, multi-tasking operating system. Multi-users may have multiple tasks running sumiltaneously. This is different than PC operating system UNIX is a machine independent operating system. Designed from the beginning to be independent of the computer hardware

Introduction unix Developed at Bell Laboratories in the late 1960s by Dennis Ritchie and Ken Thompson Shell is simply a program that reads in the commands you type and converts them into a form that is more readily understandable by the UNIX system

Introduction (continue.) Shell includes some fundamental programming constructs that let you make decisions, loop, and store values in variables Bourne shell was written by Stephen Bourne in Bell laboratories Bourne shell is the standard shell

UNIX System The UNIX system is logically divided into two pieces: Kernel Utilities

UNIX System (continue.) Kernel is the heart of the UNIX system and resides in the computer s memory. It allocates time and memory to programs and handle filestore and comunications Utilities disks UNIX system kernel Memory

UNIX System (continue.) Utility resides on the computer s disk and are only brought into memory as requested. Virtually every command under UNIX is a utility Shell is a utility program loaded into memory for execution whenever you log into the system

Logging in a UNIX system Terminal is connected to a UNIX system through Direct wire Modem LAN After you connect the UNIX system a login: message appears

Logging in a UNIX system (continue.) UNIX SYSTEM KERNEL getty login:

Logging in a UNIX system (continue.) init is the UNIX system init automatically starts up a getty program on each terminal port whenever the system is allowing users to log in After getty displays the message login: and some types the usernames followed by RETURN, it starts up a program called login to finish the process of logging in. Then getty disappears /etc/passwd file has one line per user

Logging in a UNIX system (continue.) UNIX SYSTEM KERNEL login getty login: Skan password: login:

Logging in a UNIX system (continue.) After login begins execution, Password: message appears User types the password and hits RETURN The user name and the password will be checked against the corresponding entry in the file /etc/passwd

Logging in a UNIX system (continue.) Every line has seven fields separated by :. The fields are : 1. Login name 2. Password (encrypted form). 3. User ID 4. Group ID 5. User information which could be First and Last name, etc … 6. Home directory 7. Program to start up when user logs in. Usually a shell program

Logging in a UNIX system (continue.) Example $ cat /etc/passwd root:x:0:1:Super-User:/:/sbin/sh daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3::/: adm:x:4:4:Admin:/var/adm: lp:x:71:8:Line Printer Admin:/usr/spool/lp: uucp:x:5:5:uucp Admin:/usr/lib/uucp: nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico listen:x:37:4:Network Admin:/usr/net/nls: nobody:x:60001:60001:Nobody:/: noaccess:x:60002:60002:No Access User:/: nobody4:x:65534:65534:SunOS 4.x Nobody:/: oracle:*:101:67:DBA Account:/export/home/oracle:/bin/csh webuser:*:102:102:Web User:/export/home/webuser:/bin/csh abuzneid:x:103:100:Abdelshakour Abuzneid:/home/abuzneid:/sbin/csh $

Logging in a UNIX system (continue.) UNIX SYSTEM KERNEL /bin/sh /usr/lbin/ksh /usr/data/bin /dat_entry login: Skan password: $ login: login: Med password: $ login: slim password: $

After Shell starts When shell starts up, it displays a command prompt: $ in Bourne shell and Korn shell % in C shell Shell goes to sleep after every command or program followed by RETUN until the program has finished This copied program is called a process

init Login cycle init getty login init sh

Login cycle (continue.) Shell nameUtility Developed by Bourne shellsh Stephen Bourne Korn shellkshDavid Korn C shellcshBill Joy

Responsibilities of Shell Program Execution Variable and File Name Substitution I/O Redirection Pipeline Hookup Environment Control Interpreted Programming Language

Program Execution Format: program-name arguments The shell scans the command line and determines the name of the program to be executed and what argument to pass to the program Multiple occurrences of white spaces characters are simple learned

Program Execution (continue.) $ mv oldfile newfile $ echo Smile, you are in Bridgeport City Smile, you are in Bridgeport City $ oldfile newfile mv arguments Smile, you are in Bridgeport City echo arguments

Program Execution (continue.) Shell has some built_in commands which execute them directly without searching the disk cd, pwd and echo are built_in commands

Variables and File Name Substitution assign values to variables $ list=ls $ ls Carthage Damas $ $list Carthage Damas file name substitution on the command line * ? []

Variables and File Name Substitution (continue.) Examples $ ls Documents Memos mail personal $

Documents Memos mail personal echo arguments Variables and File Name Substitution (continue.) $ echo * Documents Memos mail personal $

Variables and File Name Substitution (continue.) $ ls Documents mail Documents: a.doc c.doc p1 p11 mail: p1 p2 $

Input/Output Redirection <InputInput From a file <<Here Document Read From Shell Script >OutputDirect to a File >>OutputAppend to a File Examples $ wc -l list 2 list $ wc -l < list 2 $

Input/Output Redirection (continue.) -l users wc arguments -l wc arguments

Input/Output Redirection (continue.) In the first command line, two arguments where passed to wc (word count) utility: -l and users In the second command line, one argument is passed to wc utility: -l. This gives the indication that the number of lines appearing on standard input is to count

Pipeline Hookup Connects to commands Pipe characters: | ^ Connects the standard output from the command preceding | to the standard input of the one following the |

Pipeline Hookup (continue.) Example: $ who | wc -l Counts the number of users login to the system by connecting the standard output of who to the standard output for wc

Basic Unix commands cat file Concatenate or type out a file cat file1 file2... Type out a number of files cd directory1Change current directory to directory1 cd /usr/binChange current directory to /usr/bin cd Change back to your home directory clearClear the current screen cp file1 file2Copy file1 to file2 cp file1 file2... dir Copy a number of files to a directory ls List the files in the current directory ls /usr/binList the files in the /usr/bin directory lpr file1Print file1 out lpr file1 file2...Print a number of files out more fileLook at the content of a file with paging, use q to get out mkdir directoryCreate a directory mv file1 file2Move file1 to file2, like rename. mv file1 file2... dirMove a number of files into a directory mv dir1 dir2Move or rename a directory

Basic Unix commands (continue) rm file Remove a file rm file1 file2.. Remove a number of files rm -r directory Remove a directory include the sub-directory rmdir directory Remove a directory

DOS CommandUnix CommandDescriptions CDcdChange directory CHKDSK duDisk usage CLSclearClear the current screen COPYcpCopying files DELrmRemoving files or directories DIRlsFile listing of directories MDmkdirCreate a directory MOREmoreType out a file with paging PRINTlprPrint out a file RDrmdirRemove a directory RENAME mvMoving files around TYPEcatType out files Unix commands vs DoS

Who, When, Why, What and Where? man cpDisplay on-line manual for the cp command man -k keywordDisplay manual help file related to the keyword passwdChange your login password pwdDisplay the path name of where you are uptimeTell you how long the machine has been up and running usersTell you who is logging in whoTell you who is logging-in in detail wTell you who is logging in and doing what! whoamiShow you the owner of this account finger userFind out the personal information of a user finger nameTry to find the persons info. by his/her name finger -addressTry to find the persons info across the network write userWrite a message on somebodys screen talk userTalk to the person logging in the same system with you talk -addressTalk to somebody logging in the network dateDisplay todays time and date cal yearDisplay the calendar of the specified year (e.g. 1997)

References UNIX SHELLS BY EXAMPLE BY ELLIE QUIGLEY UNIX FOR PROGRAMMERS AND USERS BY G. GLASS AND K ABLES UNIX SHELL PROGRAMMING BY S. KOCHAN AND P. WOOD