UMBC CMSC 104 – Section 01, Fall 2016

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
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.
Linux+ Guide to Linux Certification, Second Edition
The Growing Popularity of Linux in E-Commerce Linus Torvalds.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
CMSC 104, L031 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
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”
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.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Some content in this lecture added.
Operating Systems and Using Linux CMSC 104, Lecture 3 John Y. Park 1.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Unix/Linux for beginners:
Linux and Java Basics. What is Linux? Operating system by Linus Torvalds that was a clone of Unix (thus Linux) Free and open source – this is the reason.
Introduction to Programming Using C An Introduction to Operating Systems.
CMSC 104, Section 301, Fall Lecture 04, 9/11/02 Operating Systems and Using Linux Review Operating System. Linux Overview. Frequently Used Linux.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Operating Systems and Using Linux Courtesy of John Y. Park 1.
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.
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Assignprelim.1 Assignment Preliminaries © 2012 B. Wilkinson/Clayton Ferner. Modification date: Jan 16a, 2014.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Tutorial Six Linux Basics CompSci Semester Two 2016.
By Jonathan Rinfret UNIX/LINUX By Jonathan Rinfret
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.
CS1010: Intro Workshop.
Department of Computer Engineering
Introducing the UNIX Operating System.
Web Programming Essentials:
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
UNIX The Basics Source:
Andy Wang Object Oriented Programming in C++ COP 3330
3.4 User Interfaces This tutorial will give you a first-hand experience of: Navigating the directory structure in a CLI and an unfamiliar GUI Running the.
Unix Shells.
The Command Prompt Commands are the way to “do things” in Unix
Assignment Preliminaries
Operating Systems and Using Linux
Intro to UNIX System and Homework 1
Operating Systems and Using Linux
Telnet/SSH Connecting to Hosts Internet Technology.
Operating Systems and Using Linux
CSE 390a Lecture 1 introduction to Linux/Unix environment
Operating Systems and Using Linux
Operating Systems and Using Linux
Web Programming Essentials:
CSE 390a Lecture 1 introduction to Linux/Unix environment
Operating Systems and Using Linux
Operating Systems and Using Linux
Andy Wang Object Oriented Programming in C++ COP 3330
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Operating Systems and Using Linux
Operating Systems and Using Linux
Command line.
CSE 303 Concepts and Tools for Software Development
Operating Systems and Using Linux
Module 6 Working with Files and Directories
What is Unix? A multi-user networked operating system
introduction to Linux/Unix environment
Presentation transcript:

UMBC CMSC 104 – Section 01, Fall 2016 Operating Systems

Saw This On Reddit…

Notes & Announcements Thursday will be a lab day. We will do part 1 of Project 1 together. If you can’t make it, the project will be posted after class Next Tuesday we will not have class. …but it’s a great time to do part 2 of Project 1 if you haven’t finished it by then. Next Monday I will be giving a talk at the Microsoft office in Elkridge (15 minutes from here) from 7-9 PM Topic: Getting started with Universal Windows Platform development Open to the public. Also, Pizza! More info & registration: aka.ms/uwpdevtalk

Fractions in Alternate Number Systems A7.BC16 10 x 161 160 7 11 16-1 .6875 12 16-2 .046875 167.73437510

Operating Systems Overview Topics What is an Operating System? Types of Operating Systems Interacting with an Operating System Linux Overview Frequently Used Linux Commands Emacs

What is an Operating System (OS)?

What is an Operating System (OS)? The base software that makes your computer work Performs many operations, such as: Allows you to communicate with the computer (tell it what to do) Controls access (login) to the computer Keeps track of all processes currently running Has code to do common tasks like writing to disk, displaying a graphic, etc. At this point, your main concern is how to communicate with the computer using the OS

Major Operating Systems Microsoft Windows UNIX Variants Apple macOS / iOS Built on Darwin, a UNIX variant Linux Chromium Android

Lesser-known Operating Systems DOS variants MS DOS, PC DOS, FreeDOS Still used often in Point of Sale systems UNIX variants BSD, AIX, IRIX Mostly for servers OS/2 ReactOS Haiku TempleOS

Interacting with an OS Two primary types of OS Interfaces Typically the user is able to interact directly with the OS using I/O devices Keyboard, Mouse, Touchscreen, Microphone, etc. Two primary types of OS Interfaces Command Line Interface (CLI) Graphical User Interface (GUI)

The Command Line Interface Text-only Main method of interaction for first PCs Still frequently used by power users A fast, efficient way to perform certain tasks Great for scripting and repeatable tasks Create 10,000 empty files. 2 minutes via CLI, HOURS via GUI A favorite for programmers, and our focus for this class No need to complicate things…

The Graphical User Interface Text + Graphics Often uses a mouse or touchscreen Point & Click or Tap & Swipe More User-friendly Easier for novice users Provided by nearly all modern OSes, although it is often optional Yes, you can still run Windows, macOS, and Linux without a GUI!

The Shell The Shell is the part of the OS that you interact with GUI CLI Windows Explorer DOS/PowerShell macOS Aqua BASH, others Linux GNOME, others

Remote Connectivity One advantage to CLI interfaces is they provide a very low bandwidth way to connect remotely Works great even with a slow or high-latency connection telnet is a very simple protocol that provides connectivity to the CLI of a remote machine Instead of sending characters and control data to the local computer's screen, send it over a network connection Very simple, but also very insecure -- anyone "listening" can see everything! Secure Shell (SSH) is like telnet, but with encryption Similar simplicity to telnet, much more secure We will be using SSH for this class

Linux

A Brief History of Linux Started in 1991 by Linus Torvalds while he was a student at University of Helsinki Initially envisioned as a free replacement for MINIX MINIX was a minimal UNIX-like OS for PCs targeted at students with freely available source code but expensive licensing terms Originally not licensed for commercial distribution; later changed to GNU GPL license Quickly embraced and extended by the community

The Origins of Linux From: torv...@klaava.Helsinki.FI (Linus Benedict Torvalds) Newsgroups: comp.os.minix Subject: What would you like to see most in minix? Summary: small poll for my new operating system Keywords: 386, preferences Message-ID: <1991Aug25.205708.9541@klaava.Helsinki.FI> Date: 25 Aug 91 20:57:08 GMT Organization: University of Helsinki Lines: 20 Hello everybody out there using minix - I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things). I've currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I'll get something practical within a few months, and I'd like to know what features most people would want. Any suggestions are welcome, but I won't promise I'll implement them :-) Linus (torv...@kruuna.helsinki.fi) PS. Yes - it's free of any minix code, and it has a multi-threaded fs. It is NOT protable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(.

The UNIX Family Tree

Linux Today Powers billions of computers worldwide Every Android & Chromium Device The majority of modern internet servers Many supercomputers and special purpose computers Still directed by Linus Torvalds Built by contributions from thousands of developers and corporations since 1991

Linux on Desktop Computers As of June 2016…

Linux on Mobile Devices As of August 2016…

Linux on Web Servers As of June 2016…

Why Linux? Community Availability Price “Freedom” Linux has a huge academic and business community built around it Availability Linux (and it’s associated source code) is available for nearly every conceivable platform Price Because the GNU GPL license specifies that source code must be provided with every distributed copy, Linux is freely available “Freedom” Anyone can do anything they want with Linux; you’re free to customize it however you want, as long as you make the source code freely available.

Linux Distributions

Linux Distributions

Logging into Linux On a UMBC Lab PC From Home Launch VMWare Workstation Choose Linux VM & power it on Wait for it to boot Log in at the prompt Launch Terminal From Home Windows: PuTTY, Bash on Ubuntu on Windows PuTTY also available on UMBC Lab PCs macOS: Terminal See slides from first class

Accessing UMBC GL Machines UMBC provides internet-connected Linux machines for development and general use Connect via SSH Note to Windows users: PuTTY is an SSH client All projects will be tested and graded here The version of Linux installed in lab machines is NOT guaranteed to be the same as GL To connect to GL: Open a Terminal window Connect via SSH using the following command ssh userid@linux.gl.umbc.edu

Accessing GL Machines (con’t) When you connect the first time via SSH, you may see a prompt asking you to accept a certificate. Type yes. A warning screen appears before a password prompt. When you type your password at the prompt, you will not see any characters or cursor movement. This is for your protection. After a successful login, you will see your last login date and time (if applicable) and the “Message of the Day” (aka motd). UMBC’s motd hasn’t changed in years…

The Linux Command Prompt When you log in to the Linux system here, a user prompt will be displayed. It might look like this: linux#[1]% _ …where # is the number of the Linux server that you have connected to. You may use any of the Linux servers. The number in the brackets will change as you work. It is the “number” of the command that you are about to type. If this prompt is not on the screen at any time, you are not in the shell and are not communicating with the OS.

Files A file is a sequence of bytes. It can be created by a text editor (emacs, nano, etc) a computer program (such as a C program) It may contain a program, data, a document, or other information . Files that contain other files are called directories (sometimes called folders).

Linux Filenames Restrictions May not contain certain reserved characters Have a maximum length Are case sensitive Note: This is NOT the case with Windows! It is best to stick with filenames that contain letters (uppercase or lowercase), numbers, and the underscore ( _ ) for now.

Directories Directories contain files or other directories called subdirectories. They may also be empty. Directories are organized in a hierarchical fashion. They help us to keep our files organized.

Directories (con’t) /afs/umbc.edu/users/j/d/jdoe28 junk recipes notes pies cookies CMSC104 apple peach choc_chip

Directories (con’t) Directory Structure of jdoe28 jdoe28 junk recipes pies apple peach cookies choc_chip notes CMSC104

Directories (con’t) Your home directory is where you are located when you log in (e.g., /afs/umbc.edu/users/j/d/jdoe28). Tip: type cd at the shell prompt (with no arguments) to return to your home directory The current directory is where you are located at any time while you are using the system. Files within the same directory must be given unique names. Remember that Linux filenames are case sensitive. Hello.txt and hello.txt are two different files! Paths allow us to give the same name to different files located in different directories. Each running program has a current directory and all filenames are implicitly assumed to start with the name of that directory unless they begin with a slash.

Subdirectories Are used for organizing your files For example, CMSC104 make a subdirectory for CMSC104 make subdirectories for each project CMSC104 project1 project2 . . . project8

Moving in the Directory Tree . (dot) is the current directory. . . (dot-dot) is the parent directory. Use the Linux command cd to change directories. Use dot-dot to move up the tree. Use the directory name to move down. Use the complete directory name (path name) to move anywhere.

Frequently Used Linux Commands pwd, ls, cd – Directory Viewing mkdir, rmdir – Directory Manipulation cat, more – File Viewing cp, mv, rm, touch – File Manipulation clear, man, history , who ctrl-c, ctrl-z References: Linux man page Links from the 104 homepage Books and the Internet

Directory Viewing Commands cd Change Directory Can change to absolute path (beginning with /) or relative path (beginning without /) pwd Print Working Directory Displays full path of your current directory ls List files in directory Use ls –al to get more detailed view

Directory Manipulation Commands mkdir Make Directory Absolute or Relative paths rmdir Remove Directory

File Viewing Commands cat more Short for concatenate Dumps file contents to terminal more Displays file on terminal, one page at a time Use Page Up and Page Down, arrow keys, etc. to scroll Press q to quit

File Manipulation Commands cp Copy (cp <source> <destination>) Works with absolute and relative paths mv Move (mv <source> <destination>) Also useful for renaming rm Remove (aka delete) touch Creates a blank file if one does not exist Updates timestamp on existing file

Miscellaneous Commands clear Clears the terminal screen man Manual Page Shows you instructions on how to use a command e.g. man ls history Shows you commands you have previously run Cycle through your previous commands using the up arrow who Displays users logged into system and what they are running

Wildcard Characters You will find wildcard characters useful when manipulating files (e.g., listing or moving them). The wildcard characters are * and ? ? is used to represent any single character. * is used to represent 0 or more characters.

Text Editors in Linux Because the command line is text based, there are a number of text editors available Generic nano Special-purpose emacs / xemacs vi / vim

Using nano The nano text editor works like you would expect any standard text editor to. Arrow keys to move around, tabs with tabstops, etc. Shortcut options (like save and exit) are available at the bottom of the screen. In this context, the ^ character represents the Ctrl button.

Using emacs The emacs editor provides a lot more functionality, especially for programming It’s also a lot more complicated… Emacs also has a GUI frontend. If you’re in the lab and running Linux via VMWare, this should appear. Otherwise the text-only version will appear Launching emacs with no parameters will display the help screen

Emacs

Emacs Shortcuts Emacs shortcuts typically begin with C- or M- C- means Ctrl, then the specified key M- means Meta (aka Escape), then the specified key You can quit emacs at any time using C-x C-c That’s Ctrl-x then Ctrl-c If you’re working on an unsaved file, you will be prompted to save. I’ve posted a list of common emacs shortcuts on the class webpage

What Editor Should I Use? You can use whatever editor you want for this class. If you plan on taking more CMSC courses, it may behoove you to learn emacs A purpose-built editor like emacs makes adhering to the coding standards easier

Questions?