Operating Systems and Using Linux

Slides:



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

The UNIX SYSTEM Introduction to Networking. Unix Tools Shells Useful Commands Pipes & Redirects.
1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
THE UNIX SYSTEM Ashish Gupta TA, Intro to Networking Jan Recital 2 Introduction to Networking, Instructor: Prof. Yan Chen.
Lecture 01CS311 – Operating Systems 1 1 CS311 – Lecture 01 Outline Course introduction Setting up your system Logging onto the servers at OSU with ssh.
Introduction to Linux/UNIX. History UNIX beginnings in 1969 (Linus Torvalds is born!) AT & T Bell Laboratories (Ken Thompson & Dennis Richie) Working.
Linux Commands LINUX COMMANDS.
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.
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”
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Cmsc 312 Operating Systems. UNIX? DOS – PC? VAX/VMS - mainframe Unix – PC, workstation, mainframe 1970 bell Lab For computer scientist? Why popular? Free.
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.
CS 6560 Operating System Design Lecture 3:Tour of GNU/Linux.
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.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
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.
Lesson 2 1.Commands 2.Filename Substitution 3.I/O Redirection 4.Command Grouping 5.Shell Responisibilites Review of the Basics.
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.
Introduction to Programming Using C An Introduction to Operating Systems.
Linux Commands C151 Multi-User Operating Systems.
THE UNIX SYSTEM Jan Recitation 2 Introduction to Networking.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
Operating Systems and Using Linux Courtesy of John Y. Park 1.
Learning Unix/Linux Based on slides from: Eric Bishop.
1 Linux Commands. 2 Path You specify a file or directory by its path name:  the full, or absolute, path name or the one relative to a location. The full.
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.
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
Tools of Web Development 1: Module C: Using Unix
The Linux Operating System
Tutorial of Unix Command & shell scriptS 5027
Basic UNIX OLC Training.
Introduction to UNIX.
Tutorial of Unix Command & shell scriptS 5027
Operating Systems and Using Linux
Operating Systems and Using Linux
Operating Systems and Using Linux
Introduction to Linux Week 0 - Thursday.
John Carelli, Instructor Kutztown University
Operating Systems and Using Linux
Operating Systems and Using Linux
Tutorial of Unix Command & shell scriptS 5027
Introduction to Linux/UNIX
Shells, Help, and Paths.
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
Linux Shell Script Programming
CSE 303 Concepts and Tools for Software Development
Operating Systems and Using Linux
Module 6 Working with Files and Directories
Operating Systems and Using Linux
Introduction to Linux Commands
LPI Linux Certification
Presentation transcript:

Operating Systems and Using Linux 2008/09/15: Lecture 3, part 2 CMSC 104, Section 0101 John Y. Park [New]

Operating Systems and Using Linux Topics Why a Command Line? Common Commands The Shell(s) Directories: ‘.’ & ‘..’ I/O Redirection and Pipes Command Line Editing & History

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

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

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

Directories – Review (cont) “All roads lead to Root” (“inverted tree” metaphor) Like geneology tree, refer to “self”, “child”, “parent” Every program (including the shell) has concept of “current (or working) directory” When you log in to Unix, your current directory is set to your home directory

Directories – Review A path is a file (or directory) specification: Can start at root (“/foo/fum”) or… Relative to current dir (“fee/fie”) . and .. are current dir and parent dir, respectively

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

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

I/O Redirection All programs read from standard “channel”, write to standard “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

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

Pipes Syntax: Example: 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

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