Introduction to UNIX CS208.

Slides:



Advertisements
Similar presentations
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Advertisements

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.
Introduction to UNIX Acknowledgement:Thanks to Dr Andrew Horner for the original version of this set of slides. All trademarks are the properties of their.
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.
Using UNIX Basic Commands CS465. The Virtual Terminal You log on to Unix via a virtual terminal. –via telnet or secure shell (ssh) Your terminal session.
UNIX Utilities Software Tools. Slide 2 Getting Started on UNIX The machines in CS Lab2 are named csl2wk01 through csl2wk41. csl2wk01 means “CSLab2, workstation#1”
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Guide To UNIX Using Linux Third Edition
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
Introduction to UNIX Acknowledgement:Thanks to Dr Andrew Horner for the original version of this set of slides. All trademarks are the properties of their.
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.
An Introduction to Operating Systems. Definition  An Operating System, or OS, is low-level software that enables a user and higher-level application.
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.
What is Unix Prepared by Dr. Bahjat Qazzaz. What is Unix UNIX is a computer operating system. An operating system is the program that – controls all the.
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.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Lesson 4 Computer Software
What is UNIX? UNIX is an Operating System (OS). An operating system is a control program that helps the user communicate with the computer hardware. UNIX.
 Adnan Niazi November UNIX Lecture Goals  Goal 1: Know basic UNIX commands and their use.  Goal 2: Understand the basic structure of a common.
Chapter 10 – UNIX. History In late 1960s, two employees of Bell Labs (Ken Thompson & Dennis Ritchie) designed a new operating system to overcome the constraints.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Introducing UNIX EMBnet slide 1 Introducing the UNIX Operating System.
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.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Module 1 Introduction to UNIX/Linux
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.
Jozef Goetz, expanded by Jozef Goetz, 2009 Credits: Parts of the slides are based on slides created by UNIX textbook authors, Syed M. Sarwar, Robert.
UNIX and Shell Programming (06CS36) Unit 1 Continued… Shrinivas R. Mangalwede Department of Computer Science and Engineering K.L.S. Gogte Institute of.
CS240 Computer Science II Introduction the Unix File System and File Related Utilities Based on “UNIX for Programmers and Users” by G.Class and K. Ables.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
Natawut NupairojAssembly Language1 Unix Survival Guide.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
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.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Operating Systems.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
CS2204: Introduction to Unix January 19 th, 2004 Class Meeting 1 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty.
Introduction to Programming Using C An Introduction to Operating Systems.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Linux Commands C151 Multi-User Operating Systems.
Basic UNIX Concepts. Why We Need an Operating System (OS) OS interacts with hardware and manages programs. A safe environment for programs to run is required.
Chapter 9: Networking with Unix and Linux. Objectives: Describe the origins and history of the UNIX operating system Identify similarities and differences.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
Introduction to UNIX CS 2204 Class meeting 1 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Introduction to UNIX CS465. What is UNIX? (1) UNIX is an Operating System (OS). An operating system is a control program that allocates the computer's.
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.
Chapter Linux Basics. Acknowledgements This presentation was prepared by – Banyat Settapanich – Bahran Madaen This presentation will be updated later.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Learning Unix/Linux Based on slides from: Eric Bishop.
Operating systems Lecture #3 Modern OS characteristics.
UNIX U.Y: 1435/1436 H Operating System Concept. What is an Operating System?  The operating system (OS) is the program which starts up when you turn.
Introducing the UNIX Operating System.
Lecture #3 Modern OS characteristics
UNIX Basics Internet Technology.
Lecture #3 Modern OS characteristics
Web Programming Essentials:
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Presentation transcript:

Introduction to UNIX CS208

What is UNIX? UNIX is an Operating System (OS). An operating system is a control program that allocates the computer's resources, schedules tasks, and helps the user communicate with the computer. Most popular PC operating systems: Windows 95/98/2000/XP -- proprietary, single-user OS UNIX was developed long before Windows, about 30 years ago at AT&T Bell Labs (95% written in “C” programming language).

UNIX Compared with other OS Mature and stable OS Large user community Vendor-independent OS Network-portable window system (X) Runs on range of hardware (PC - Cray) Common Open System Environment (COSE) Source code is available to view and modify

Multi-user, Multi-tasking More than one user can run at the same time and each user can run more than one task at the same time In Unix, each program is started as a process. A process is a program in execution. Usually only one copy of a program, but there may be many processes running the same program. Each interactive user may have: only one process in foreground may have several processes in background

Most Important Feature of UNIX Most important feature of UNIX: STABILITY 30 years to get the bugs out Important in shared environments and critical applications Shared Environments Example: University Windows NT crashes at least once a day in labs UNIX servers crash about once a semester (usually due to hard disk failure) UNIX more than 100 times more reliable than Windows!

UNIX Versions Two main types of UNIX: BSD (Berkeley Software Distribution)/OSF System V (developed at AT&T) Different versions of UNIX for different hardware: Sun Microsystem’s Solaris (and SunOS) Hewlett-Packard’s HP-UX IBM’s AIX SGI’s IRIX

Unix Operating System Structure OS mediates between the user and the computer User Application Programs Kernel Shell Shell - Whenever you log in,you get placed in a program called a shell. You can see the shell prompt. Enter commands at the prompt. Shell acts as a command interpreter, taking commands and passing them on to the kernel. Kernel: At the core of the Unix system, loaded whenever the system is started up (booted). Manages computer resources (memory, processes, file system) manages memory and allocates it to each process schedules work done by the CPU organizes transfer of data from one part of machine to another accepts instructions from shell and carries them out enforces access permission on the file system Hardware

Why has Unix been successful?  UNIX is portable, because it was written in C. Provides hardware independence. Open System Underlying operating system source code is available  Provides a productive environment Allows multi-tasking and sharing of data Excellent C development environment is built-in Networking capabilities are built in

Unix Disadvantages UNIX is not as user-friendly as some operating systems Command names are often cryptic User help is not great UNIX does not error check user commands to protect users from hurting themselves or the system Example: Request to copy a file over an existing file will overwrite the existing file with no warning.

Unix Disadvantages UNIX is less secure than some operating systems Developed to be used as a software development environment, in which all users are working together cooperatively. Security was traded for more convenience and flexibility. Well-documented open code makes hacking easier. UNIX's portability also makes it less efficient on any particular hardware. Proprietary operating systems are optimized for that hardware.

Basic UNIX Commands

The Unix Prompt After you log in, and the startup files have been run, the shell will display a prompt $ Different shells and different systems have different prompts. Two common prompts are $ and #. Your prompt can be changed. A prompt (plus a cursor) tells you that the system is ready for your commands. F 1-7 PD 1-7

Standard Command Format Format: command [options] <arguments> stuff in brackets is optional boldface words are literals (must be typed as is) <> enclosed words are args (replace appropriately) Commands are case sensitive (mostly lowercase) Spaces must be inserted between commands, options, arguments

Standard Command Format Options (also called flags) modify how the command works (command behavior) single letters prefixed with a dash “-” combined or separated (e.g., -al = -a -l) come before arguments Arguments define the command scope Optional for some commands, mandatory for others Some commands assume a default argument if none is supplied Usually files or directories

Basic Commands date - Print the date and time Wed Feb 3 12:13:07 MDT 2003 $ echo - Display command line input to screen $ echo Hi, I am your instructor! Hi, I am your instructor!

Commands to Manipulate Files ls lists files in a directory (names, not the contents of files) cat, head, tail, more display files rm removes files (and directories) cp copies files (and directories) mv moves (renames) files (and directories)

List Files in a Directory Format: ls [-alRF…] <file-list> -a list all files including the dot files -l long format (show file type, permissions, #links, owner, etc) -R recursive list subdirectories -F list directories with file type (trailing / *)

Listing Files in a Directory BLOCK SIZE # DIRECTORIES FILE SIZE GROUP 1 drwxr-xr-x 180 root admin 512 Oct 1 ../ 2 -rw-r--r-- 1 smith fac 1314 Oct 3 file PERMISSIONS MODIFY DATE FILE TYPE FILE NAME OWNER Permission settings will be covered in a later section. For now just remember that Unix is multi-user, and with any multi-user system you need security to prevent one person from changing another person’s file space.

Getting Help Check the manual pages! Format: man <command> For shell command, system programs, and library functions. Format: man <command> man –k <keywords> Man(ual) page format Name Synopsis Description (options, defaults, detail desc., examples) Files See Also Bugs

man Examples $ man man Displays help on the man command $ man who Displays help on the who command $ man -k mail Checks all man pages for keyword “mail”

man Output Example spacebar - move forward one page $ man ls Reformatting page. Wait... done User Commands ls(1) NAME ls - list contents of directory SYNOPSIS /usr/bin/ls [ -aAbcCdfFgilLmnopqrRstux1 ] [ file... ] /usr/xpg4/bin/ls [ -aAbcCdfFgilLmnopqrRstux1 ] [ file... ] --More--(11%) spacebar - move forward one page b – move back one page h – more commands q – quit

Viewing Files cat concatonate and print to screen (ctrl-s and ctrl-q to stop/start) head display first x lines of file tail display last x lines of file (both default to 10 lines) more display part of file to screen

Example: cat, head, tail $ cat letter Mr. Jones, It is getting late. Please order some pizza and stop by my office. We’ll tidy up a few more things before calling it a night. Thanks! Ben $ head –2 letter $ tail –1 letter

Copying Files Format: cp [-ir…] file1 file2 cp [-ir…] file-list directory cp [-ir…] directory directory i for interactive. Prompt whenever a file will be overwritten. r for recursive. copy a whole directory tree.

cp Examples $ ls letter1 secret $ cp letter1 letter2 $ ls -F letter1 letter2 secret/ $ cp letter1 letter2 secret $ ls secret letter1 letter2

Moving /Renaming Files Format: mv [-i…] file1 file2 - Renames file1 to file2 mv [-i…] file-list directory - Moves files from current location to new directory mv [-i…] directory directory - Renames a directory

mv Examples $ ls letter memo saved $ mv memo memo1 $ ls -F $ mv saved trash letter memo1 trash/

Deleting Files Format: rm file-list - Deletes files rm -r directory - Deletes directory and all files and directories within it - Use with CAUTION!

rm Examples $ ls -F letter1 letter2 secret/ $ rm letter1 $ ls –F secret memo morestuff/ $ rm –r secret $ ls letter2