Rolando V. RaqueñoThursday, June 18, 2015 1 Getting Started SIMG 726.

Slides:



Advertisements
Similar presentations
RH030 Linux Computing Essentials
Advertisements

Tony Kombol.  A program that  receives commands from a text input device (e.g. keyboard)  passes them to the operating system to perform  In the.
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.
PacNOG 6: Nadi, Fiji Using Commands in Linux Hervey Allen Network Startup Resource Center.
1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
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
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.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using the “CLI” Unix / Linux Preparation Course May 25 Djibouti.
Welcome to CSE  Name: Di Cao   Classroom: DL357  Class Time: T 8:30am - 9:18am  Office.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
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”
UNIX command line. In this module you will learn: What is the computer shell What is the command line interface (or Terminal) What is the filesystem tree.
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.
8 Shell Programming Mauro Jaskelioff. Introduction Environment variables –How to use and assign them –Your PATH variable Introduction to shell programming.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Unix Basics Chapter 4.
CENT 305 Information Systems Security Linux Introduction.
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.
Shells. A program that is an interface between a user at a terminal and the computers resouces ▫The terminal may be real or an emulator The shell is.
Agenda Chapter 1: Linux (Unix) Features Commands (Chapters 2 & 3) Command Structure / Command line editing man, passwd, cal, date, whereis, which Working.
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
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.
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.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #4  Unix software architecture  Correcting mistakes  System setups  Useful commands for the beginner.
Introduction to Unix (CA263) Getting Started By Tariq Ibn Aziz.
1 Operating Systems Lecture 2 UNIX and Shell Scripts.
Chapter 0 A “Quick-Start” into the UNIX Operating System.
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.
Using Commands Unix / Linux Preparation Course May 6, 2012 Serrekunda, The Gambia.
Winter Quarter 2003Rolando V. Raqueño Getting Started SIMG 726.
Introduction to Programming Using C An Introduction to Operating Systems.
Getting Started UNIX InKwan Yu Topics Unix Commands Unix System calls C function calls.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Using the “CLI” Unix / Linux Preparation Course June 9, 2013 Lusaka, Zambia.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
1 Winter Quarter 2004Rolando V. Raqueño Getting Started SIMG 726.
Unix Advanced Shells Chapter 10. Unix Shells u Command Line Interpreter –once logged in, login gives control to a shell –it prompts for input, then parses,
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
June 1, 1999UNIX - Basic Environment1 Introduction to UNIX A. Basic Environment.
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.
Overview of Linux Fall 2016 Dr. Donghyun Kim
Unix Shells.
The Linux Operating System
Basic UNIX OLC Training.
John Carelli, Instructor Kutztown University
Shells, Help, and Paths.
Linux Shell Script Programming
CSE 303 Concepts and Tools for Software Development
UNIX and Shell Programming (06CS36)
UNIX and Shell Programming (06CS36)
Chapter 3 The UNIX Shells
Presentation transcript:

Rolando V. RaqueñoThursday, June 18, Getting Started SIMG 726

Rolando V. RaqueñoThursday, June 18, Location of Class Notes i/teaching/simg726/20022 –Arranged by Class Number –Watch out for Posted Messages –Link to Previous year’s notes – eaching/simg726/20012

Rolando V. RaqueñoThursday, June 18, Reading On-Line Tour of IDL UNIX Reading Assignment Guide IDL Reading Assignment Guide

Rolando V. RaqueñoThursday, June 18, Objective Quiz #1 Topics Define Homework/Project #1 Brief Introduction to UNIX IDL demo More Final Project Details

Rolando V. RaqueñoThursday, June 18, Quiz #1 Topics for December 6 man ls cp mv pwd

Rolando V. RaqueñoThursday, June 18, Homework/Project #1 - Part 1 Part 1 –Copy the file.plan.blank from ~rvrpci to your home directory –Modify it to reflect your schedule –Rename the file to.plan –Change the permissions of the file to have it accessible by others (test-ask your neighbor to check to see if they can access the file through the finger command)

Rolando V. RaqueñoThursday, June 18, Purpose of Part 1 Exercises UNIX file navigation skills –copying, renaming, changing directories –handling being aware of hidden files Exercising vi skills Working with concept of file permissions and protections

Rolando V. RaqueñoThursday, June 18, Homework/Project #1 - Part 2 Part 2 –Write the following IDL functions that will compute the following statistics for any dimension array(s) Minimum Maximum Sum Mean Sum_Squares Variance Standard_Deviation

Rolando V. RaqueñoThursday, June 18, Purpose of Part 2 Getting acquainted with the IDL array characteristics. –Function utilities to extract array properties Mechanics of IDL “compilation” Opportunity for Modular design of routines –Reduce, Reuse, Recycle –Debugging LaTeX documentation exercise

Rolando V. RaqueñoThursday, June 18, Homework/Project #1 - Part 2 Test for the ambitious - Read in a PBMPLUS formatted image to test your statistics routine

Rolando V. RaqueñoThursday, June 18, Homework/Project #1 Guidelines Due Before Break Please follow the program submission guidelines (should be in LaTeX) Hardcopy submission (for marking up)

Rolando V. RaqueñoThursday, June 18, Brief Introduction to UNIX

Rolando V. RaqueñoThursday, June 18, UNIX History Approaching 30 years of development and user use/abuse –BSD Flavor –System V Flavor –Other Flavors - LINUX Originally developed by programmers for programmers Way too many commands to cover

Rolando V. RaqueñoThursday, June 18, Before we start % source ~rvrpci/.simg726.rc

Rolando V. RaqueñoThursday, June 18, The “Original” UNIX Desktop $

Rolando V. RaqueñoThursday, June 18, The “New and Improved” UNIX Desktop %

Rolando V. RaqueñoThursday, June 18, These represent UNIX Shells % prompt indicates The C-shell (csh) $ prompt indicates The Bourne-shell (sh)

Rolando V. RaqueñoThursday, June 18, Other UNIX Shells bash -“Bourne again” shell –Distributed with LINUX tcsh - C-shell variant –Allows the use of up-arrow keys ksh - Korn shell

Rolando V. RaqueñoThursday, June 18, UNIX Shell Prompt % prompt indicates C-shell $ prompt indicates Bourne-shell

Rolando V. RaqueñoThursday, June 18, What is a shell? Captures commands and schedules it for execution. Several shells running at a time –each shell is its own environment –each window is its own shell Shells in UNIX are created through a process called “spawning”

Rolando V. RaqueñoThursday, June 18, % xterm example % Under the X windowing environment –Repeatedly start several windows by giving the xterm command. % xterm &

Rolando V. RaqueñoThursday, June 18, UNIX Command Form % command [options] arg2 arg3... argn Very Important Concept –The command can be a compiled program (FORTRAN, C/C++) a file containing other UNIX commands (also called a shell script) –e.g. commands to run IDL UNIX makes no distinction between the two

Rolando V. RaqueñoThursday, June 18, % Most Important UNIX Command % % man Usage: man [-] [-M | -P pathname] [-t] [section] title... man [-] [-M | -P pathname] [-t] [section title...]... man [-M | -P pathname] -f title... man [-M | -P pathname] -k keyword... A Usage: message typically indicates that not enough arguments were given to a command or incorrect options

Rolando V. RaqueñoThursday, June 18, % Most Important UNIX Command % To correct the command we can type % man manman(1) NAME man - Displays reference pages SYNOPSIS man [-] [-M | -P pathname] [-t] [ section[suffix] ] title... man [-] [-M | -P pathname] [-t] [ section[suffix] title...]... man [-M | -P pathname] pathname] -f title... man [-M | -P pathname] -k keyword....

Rolando V. RaqueñoThursday, June 18, % Other UNIX Commands % You know the name of the command, but you need a reminder of what it does. % whatis man man (1) - Displays reference pages man, man.page (5) - The man macro packages for reference pages

Rolando V. RaqueñoThursday, June 18, % Other UNIX Commands % You know a keyword about a command, but don’t remember the command itself % apropos printer

Rolando V. RaqueñoThursday, June 18, Keyboard Control Characters ^[ - ESC key equivalent ^C - stops a currently running process (totally abort) ^Z - suspends a running process (can be restarted) ^U - erases a complete line being typed ^S - stops output to the screen ^Q - resumes output to the screen ^D - signals an interactive end-of-file condition(EOF)

Rolando V. RaqueñoThursday, June 18, Most Common Keyboard Problem Problem: You press the “backspace key” to erase a character, but instead you get ^H whenever you press it. Solution: % stty erase ^H

Rolando V. RaqueñoThursday, June 18, Most Common Keyboard Problem Problem: You press the “delete key” to erase a character, but instead you get ^? whenever you press it. Solution: % stty erase ^?

Rolando V. RaqueñoThursday, June 18, % UNIX Commands To Try % % whoami #This will print out your username. % hostname #This will print out computer name. % finger #This will print out current users % date #Gives current system time and date

Rolando V. RaqueñoThursday, June 18, Sample UNIX Directory Tree Structure

Rolando V. RaqueñoThursday, June 18, Where am I? (Two Types of Pathnames) Absolute Path (always starts with a / ) /usr/local/bin/ls /cis/students/neg3153/.login Relative Path (does not start with a / ) pub./pub../testing ~neg3153/.login

Rolando V. RaqueñoThursday, June 18, % Fundamental UNIX Commands % List files in the current directory. % ls List files in the rvrpci’s home directory. % ls /cis/staff/rvrpci % ls ~rvrpci List files in the YOUR home directory. % ls ~ Lists all files including hidden files in current directory % ls -a

Rolando V. RaqueñoThursday, June 18, % What “Else” UNIX Can Do (How do you spell releif?) % % look rel % look re % look re | more % look re | wc

Rolando V. RaqueñoThursday, June 18, % “Excuse me, Do you sell beer in the special hogshead size” % % units #Unit Conversion Program #Try miles to feet #Try furlong to yards #Try barrel to hogshead #Try dollar to yen (unreliable) # hectopascals vs. millibars # km vs. astronomicalunits #Type ^D to get out

Rolando V. RaqueñoThursday, June 18, % #%?!, I forgot my calculator! % % bc -l *20 3^100 sqrt(625) p= c(p/2) s(p/2) for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)} (type quit to get out)

Rolando V. RaqueñoThursday, June 18, % UNIX is Y2K Compliant % % cal % cal 2000

Rolando V. RaqueñoThursday, June 18, Metacharacters, Schmetacharacters In UNIX there are several characters that are not interpreted literally but contain some special meaning. These are called metacharacters. Examples |<>*&\()!

Rolando V. RaqueñoThursday, June 18, UNIX Plumbing facilities ( Piping and Input/Output File Redirection) Output File Redirection % command1 > output_file Input File Redirection % command2 < input_file Piping % command1 | command2

Rolando V. RaqueñoThursday, June 18, % Piping and Redirection Examples % % echo 2+2 % echo 2+2 > input.dat % bc -l < input.dat

Rolando V. RaqueñoThursday, June 18, % Piping and Redirection Examples % % echo 2+2 | bc -l % echo 2+2 | bc -l > output.dat % echo 2+2 | tee input.dat | bc -l > output.dat

Rolando V. RaqueñoThursday, June 18, % Line Continuation Metacharacter % In the previous command % echo 2+2 | tee input.dat | bc -l > output.dat Should technically be the following % echo 2+2 | tee input.dat | \ bc -l > output.dat Where the character “\” indicates the continuation of a command line

Rolando V. RaqueñoThursday, June 18, % More Elaborate Example % % echo “for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)}” | bc -l

Rolando V. RaqueñoThursday, June 18, % Public Service Announcement to Prevent Repetitive Motion Injury % % echo “for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)}” | bc -l % !! This recalls the last command executed % !! | paste - - % !! > sine.dat

Rolando V. RaqueñoThursday, June 18, Primitive Plotting Capabilities % echo “for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)}” | bc –l | paste - - | graph | dumbplot % cat sine.dat | graph | dumbplot

Rolando V. RaqueñoThursday, June 18, Result of dumbplot

Rolando V. RaqueñoThursday, June 18, Less than Primitive Graphing Capabilities While depressing the Ctrl button with the mouse pointer in the xterm window, –Depress the middle mouse button –Select “tekshow” –Give the following command in the new window % echo “for( f=-10.0; f<=10.0; f+=0.1 ) {f; s(f)}” | bc –l | paste - - | graph | tek

Rolando V. RaqueñoThursday, June 18, Result of tek plot

Rolando V. RaqueñoThursday, June 18, The gnuplot utility % gnuplot G N U P L O T unix version 3.5 patchlevel , 27 Aug 93 last modified Fri Aug 27 05:21:33 GMT 1993 Copyright(C) Thomas Williams, Colin Kelley Send comments and requests for help to Send bugs, suggestions and mods to Terminal type set to 'x11' gnuplot> plot 'sine.dat' gnuplot>

Rolando V. RaqueñoThursday, June 18,

Rolando V. RaqueñoThursday, June 18, The UNIX History Channel: Studying history so you can repeat it UNIX remembers the commands you have typed in through a “history list” By giving the history command, you will see a numbered list of previously executed commands

Rolando V. RaqueñoThursday, June 18, % Other Obscure UNIX Short Cuts % % !! # Recalls the last command and execute % !:p # Recalls the last command (don’t execute) % !c # Recalls the last command that begins with a c % !5 # Recalls the #5 argument in the history list

Rolando V. RaqueñoThursday, June 18, More Esoteric UNIX Short Cuts % ^string1^string2 # Performs a substitution on the previous command of the first occurrence of string1 with string2 % command !$ # Recalls the very last argument of the previous command % command !* # Recalls the all the arguments of the very last command

Rolando V. RaqueñoThursday, June 18, Or simply use up arrows if tcsh is available

Rolando V. RaqueñoThursday, June 18, IMPORTANT UNIX Concepts Environment and Shell Variables –These allow you to customize your UNIX environment –They are different in terms of their SCOPE SCOPE determines the visibility of a variable

Rolando V. RaqueñoThursday, June 18, Other IMPORTANT UNIX Concepts Environment Variable –Examples are TERM and DISPLAY –Set a particular variable to a value by using the setenv command –You can print the value of a particular variable or all the environment variable using the printenv command

Rolando V. RaqueñoThursday, June 18, % Environment Variables % Examples –To set environment variables % setenv TERM vt100 % setenv DOG Goofy –print out the terminal type % printenv TERM vt100 –print out all environment variables % printenv

Rolando V. RaqueñoThursday, June 18, Shell Variables Shell variables are similar to Environment variables except they have a limited scope, i.e., they exist only in the shell which they are defined. Environment variables on the other hand, exist in all its children shells To illustrate this concept, let us look at the following example

Rolando V. RaqueñoThursday, June 18, Environment vs. Shell Variables % set prompt = "Parent Shell > " Parent Shell > setenv DOG Goofy Parent Shell > set mouse=Mickey Parent Shell > printenv DOG Goofy Parent Shell > echo $mouse Mickey Parent Shell > xterm & (YOU SHOULD NOW HAVE A NEW xterm WINDOW) THIS IS KNOWN AS “SPAWNING A NEW (OR CHILD) PROCESS”

Rolando V. RaqueñoThursday, June 18, Environment vs. Shell Variables (IN THE NEW xterm WINDOW, DO THE FOLLOWING) % set prompt = "Child Shell > " Child Shell > printenv DOG Goofy Child Shell > echo $mouse mouse: Undefined variable.

Rolando V. RaqueñoThursday, June 18, Environment vs. Shell Variables Child Shell > setenv DOG Pluto Child Shell > set mouse=Minnie Child Shell > printenv DOG Pluto Child Shell > echo $mouse Minnie Child Shell > exit (THE xterm WINDOW SHOULD NOW GO AWAY - THIS PROCESS HAS NOW BEEN KILLED)

Rolando V. RaqueñoThursday, June 18, Environment vs. Shell Variables Parent Shell > Parent Shell > printenv DOG Goofy Parent Shell > echo $mouse Mickey Parent Shell >

Rolando V. RaqueñoThursday, June 18, Environment & Shell Variables Why is this important? –UNIX uses Environment and Shell Variables control a number of processes – Customizes your working environment –Variables used for UNIX Scripts They are typically defined and initialized in your.login and.cshrc files

Rolando V. RaqueñoThursday, June 18, Useful Shell Variables filec #Allows file completion path #List of command directories cdpath #List of candidate directories to cd into history #Number of commands to remember

Rolando V. RaqueñoThursday, June 18, The X-Windows Environment

Rolando V. RaqueñoThursday, June 18, X-Windowing System Vendor independent Graphical User Interface (GUI) Works on a network client/server concept. The client is some entity (in this case a software package, IDL, for instance) that requests from another entity some form of service (e.g., IDL requests for program input or requests some output data to be displayed)

Rolando V. RaqueñoThursday, June 18, X-Windowing System Windowing interface is decoupled from the software application Possible to remotely control software running at another location. rocky.cis.rit.edu bullwinkle.whatsomatau.edu

Rolando V. RaqueñoThursday, June 18, Starting IDL remotely 0. Find out the name of the local workstation you are working on by typing the following commands % hostname 1. On the local workstation, type the following % xhost + 2. Remotely log on to another machine using telnet. If you choose to use the computer “ride”, you would type % telnet ride.cis.rit.edu.

Rolando V. RaqueñoThursday, June 18, Starting IDL 3. Check environment variable telling the remote system the name of your workstation. For example, if your local workstation was named “glen”, you would type % echo $DISPLAY % setenv DISPLAY glenn.cis.rit.edu: Run idldemo on the remote system; display graphics will be directed back to your local workstation.

Rolando V. RaqueñoThursday, June 18, Other X-clients xterm xclipboard gnuplot ghostview acroread xfig xv

Rolando V. RaqueñoThursday, June 18, xclipboard Allows cutting and pasting text fragments to and from files

Rolando V. RaqueñoThursday, June 18, gnuplot Allows quick plotting of data files

Rolando V. RaqueñoThursday, June 18, ghostview X client used to view files in postscript format (*.ps)

Rolando V. RaqueñoThursday, June 18, acroread X client to read PDF (portable document files) files

Rolando V. RaqueñoThursday, June 18, xfig X client to create drawings in EPS format

Rolando V. RaqueñoThursday, June 18, xv X client to view most standard images

Rolando V. RaqueñoThursday, June 18, FINAL Project Information Two design review presentations (10-15 minutes long) What’s already out there to solve your problem How can you improve on it? Your plan of implementation and testing A Final Document of your Project –(PDF or HTML file desirable) Teaming is Encouraged

Rolando V. RaqueñoThursday, June 18, Previous Projects –Visualization of a DIRSIG Geometric Database –Visualization and modification of radiosonde data –IDL GUI to Visualize MODTRAN Output Data –Graphical User Interface for generating and modifying a MODTRAN Card deck –GUI for generating and modifying object material parameters –GUI for visualizing emissivity files

Rolando V. RaqueñoThursday, June 18, Previous Projects –An IDL FFT Widget Based on Dr. Easton's Signals. –GUI for Displaying the CIELAB Color Matching Functions –Astronomical Image Analysis in IDL –Stereo Visualization of Plots –GUI for Visualizing Atmospheric Parameters –GUI for texture image creation and visualization

Rolando V. RaqueñoThursday, June 18, Previous Projects –GUI for Modifying Material Parameters –Spectral Unmixing GUI Utilizing ENVI –Interface to Generate Satellite Image Preview and rendering using IDL’s globe and map database –Bi-directional Reflectance Parameter Viewer –Ephemeris program interface –Thermal Image apparent temperature predictor