Operating Systems and Using Linux Courtesy of John Y. Park 1.

Slides:



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

Chapter One The Essence of UNIX.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
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 UNIX File System.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
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”
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.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Cmsc 312 Operating Systems. UNIX? DOS – PC? VAX/VMS - mainframe Unix – PC, workstation, mainframe 1970 bell Lab For computer scientist? Why popular? Free.
CENT 305 Information Systems Security Linux Introduction.
Linux+ Guide to Linux Certification Chapter Four Exploring Linux Filesystems.
Linux+ Guide to Linux Certification, Third Edition
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.
Chapter Two Exploring the UNIX File System and File Security.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
Week 3 Exploring Linux Filesystems. Objectives  Understand and navigate the Linux directory structure using relative and absolute pathnames  Describe.
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.
Operating System What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Unix/Linux for beginners:
Introduction to Programming Using C An Introduction to Operating Systems.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
File and Folder CLI Commands 12/24/ Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
CMSC 104, Section 301, Fall Lecture 04, 9/11/02 Operating Systems and Using Linux Review Operating System. Linux Overview. Frequently Used Linux.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
CMSC 104, Section 301, Fall Lecture 03, 9/09/02 Operating Systems and Using Linux Topics Review Number Systems. Go over Homework 1 Solution. CSHC.
CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.
+ Introduction to Unix Joey Azofeifa Dowell Lab Short Read Class Day 2 (Slides inspired by David Knox)
Learning Unix/Linux Based on slides from: Eric Bishop.
UNIX  Portable (common to many computer architectures), multitasking, multi-user operating system  Introduced by Bell labs in mid-1960’s  Thus, much.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
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.
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
Tools of Web Development 1: Module C: Using Unix
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Introduction to Linux Week 0 - Thursday.
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Andy Wang Object Oriented Programming in C++ COP 3330
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Module 6 Working with Files and Directories
What is Unix? A multi-user networked operating system
Operating Systems and Using Linux
Presentation transcript:

Operating Systems and Using Linux Courtesy of John Y. Park 1

2 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

3 What is an Operating System? A computer program that: Controls how the CPU, memory and I/O devices work together to execute programs 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 Often referred to as simply OS

What is an Operating System? Provides a uniform interface for users and programs to access changing, evolving hardware (H/W) Very different H/W platforms can support a common OS (partially custom-written, of course) (standard “PC”, Sony PSP can both run Linux) One H/W platform can support multiple OSs E.g.: Latest Macs can run MacOS or Windows 4

5 How Do I Communicate With the Computer Using the OS? You communicate using the particular OS’s user interface. Graphical User Interface (GUI) – Windows, Linux Command-driven interface - DOS, UNIX, Linux We will be using the Linux operating system, which is very similar to UNIX. Notice that it is listed as both GUI and Command-driven.

6 GUI vs. Command-driven We will be using both the GUI version of Linux and the Command-driven Interface. When you connect to GL through TeraTerm, you are using only the Command-driven Interface. When you reboot the computer into Linux, you will use both the GUI and the Command- driven Interface.

7 Example of Command-driven Screenshot of connection to linux3.gl.umbc.edu

8 Example of GUI Screenshot of Fedora 7

9 Another Example of GUI Screenshot of Red Hat Enterprise Linux (RHEL) 5

10 Why a GUI? GUIs are sometimes better, because: Give a good sense of “where I am” Succinct visual summary of small sets Easier to find “forgotten” target, then act on it Simple to execute default behavior Otherwise, often resort to complex “environments”

Why a Command Line? Command lines are sometimes better, because: Easier to operate on large sets Convenient if you remember filenames (and you should) Can act on multiple objects in disparate locations Easier if no simple default behavior 11

12 How Do I Communicate With the Computer Using the OS? (con’t) When you log in to the Linux system here, a user prompt will be displayed: where # is the number of the Linux server to which you have connected. You may use any of the Linux servers: linux1, linux2 or linux3. 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 communicating with the OS. linux#[1]% _

13 Linux Overview Files and Filenames Directories and Subdirectories Frequently Used Commands

14 Files A file is a sequence of bytes. It can be created by a text editor (XEmacs or Notepad) 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).

15 Linux Filenames Restrictions Typically do not have spaces or other reserved characters Have a maximum length (typically 255 characters but who wants to type that much!) Are case sensitive For this class, you should stick with filenames that contain only letters (uppercase or lowercase), numbers, and the underscore ( _ ) or hypen (-). No spaces! Some examples: firefox.exe, things2do.txt, dinner_menu.pdf

16 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.

17 Example Directory Tree /afs/umbc.edu/users/j/d/jdoe28/home/ Mail/recipes/ courses/ pies/ cookies/ CMSC104/ apple.txt peach.txt choc_chip.txt

18 Subdirectories Are used for organizing your files For example, make a subdirectory for CMSC104 make subdirectories for each project CMSC104/ hw1/ hw3/... proj4/

19 More Directories Your home directory is where you are located when you log in (e.g., /afs/umbc.edu/users/j/d/jdoe28/home/). The current directory is where you are located at any time while you are using the system. The / (pronounced “slash”) is the root directory in Linux. Files within the same directory must be given unique names. 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.

20 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. cd.. Use the directory name to move down. cd recipes Use the complete directory name (path name) to move anywhere. cd /afs/umbc.edu/users/j/d/jdoe28/home/recipes/

21 Absolute Path The absolute path is a path that contains the root directory and all other subdirectories you need to access the file It points to the same location in the directory tree regardless of the current working directory An example of an absolute path /afs/umbc.edu/users/j/d/jdoe28/home/recipes/ Starts with /

22 Relative Path The relative path is a partial path to a file in relation to the current working directory If inside of the home directory in the previous directory example, a relative path would be recipes/cookies/ Does not start with /

23 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. For example, ls hw?.txt would match the files hw1.txt and hw2.txt but not hw123.txt * is used to represent 0 or more characters. For example, ls hw*.txt would match the files hw1.txt and hw2.txt, as well as hw.txt, hw123.txt and hw_assignment.txt

24 What is a “Shell”? The “most important program in the OS” Your primary means of controlling the OS On Linux, just another program! Can use other shells: sh, csh, bash, tcsh Can be programmed to do complex tasks Every command (almost) is just running another program Main differences are in syntax, ease of use

Common Commands Directory operations: pwd, cd, mkdir, rmdir File manipulation: ls, rm, cp, mv, cat File examination cat, more, less, head, tail, file File editing ed, emacs, sed Misc (pine, find, etc.) 25

26 I/O Redirection All programs read from standard input “channel”, write to standard output “channel” Called “file descriptors” Shell can manipulate these file descriptors before executing command (i.e., program) Devices and files treated similarly “<“: redirect input “>”: redirect output

27 I/O Redirection Examples: % ls > my-files.txt % wc < my-files.txt

28 Pipes Communications channel between two programs Can think of as a temporary file that first program writes to, second program then reads from Syntax: % program1 | program2 Example: % ls | wc will give you the number of files you have

29 Command Line Editing Allows command to be edited before being executed Uses subset of emacs commands: Ctl-B, Ctl-F, Ctl-A, Ctl-E,, Ctl-D Allows previous commands to be recalled, then optionally edited Very convenient for: Typos Repetitive commands