Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Similar documents
Introduction: What is Unix?

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

Introduction to remote command line Linux. Research Computing Team University of Birmingham

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

Introduction To. Barry Grant

CS CS Tutorial 2 2 Winter 2018

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Chap2: Operating-System Structures

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Perl and R Scripting for Biologists

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

Introduction to Linux Organizing Files

CS Fundamentals of Programming II Fall Very Basic UNIX

Unix. Examples: OS X and Ubuntu

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

Lab 2: Linux/Unix shell

Linux Command Line Interface. December 27, 2017

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

Introduction to the shell Part II

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Traditional Access Permissions

Linux Bootcamp Fall 2015

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Lec 1 add-on: Linux Intro

CISC 220 fall 2011, set 1: Linux basics

Exercise 1: Basic Tools

Introduction to Linux

Introduction to Linux Workshop 1

Introduction to Linux

Computer Systems and Architecture

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Unix Essentials. BaRC Hot Topics Bioinformatics and Research Computing Whitehead Institute October 12 th

Introduction to the Linux Command Line January Presentation Topics

Lab 1 Introduction to UNIX and C

Review of Fundamentals

Mills HPC Tutorial Series. Linux Basics I

Computer Systems and Architecture

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Introduction to Linux for BlueBEAR. January

UNIX Quick Reference

XSEDE Scholars Program Introduction to the Linux Environment. Tips and Tricks for Linux Users John Lockman III June 5 th, 2012

Introduction to the Linux for HPC. Basic Linux for Beginner HPC Users

Part I. UNIX Workshop Series: Quick-Start

Traditional Access Permissions

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

Introduction to UNIX Command Line

M2PGER FORTRAN programming. General introduction. Virginie DURAND and Jean VIRIEUX 10/13/2013 M2PGER - ALGORITHME SCIENTIFIQUE

Version Control with Git

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

CS370 Operating Systems

Recap From Last Time: Setup Checklist BGGN 213. Todays Menu. Introduction to UNIX.

Recap From Last Time:

Introduction to the UNIX command line

Linux Command Line Primer. By: Scott Marshall

UNIX Essentials Featuring Solaris 10 Op System

BGGN 213 Working with UNIX Barry Grant

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

The Unix Shell & Shell Scripts

Introduction to the Linux Command Line

Linux at the Command Line Don Johnson of BU IS&T

5/20/2007. Touring Essential Programs

Introduction to UNIX. SURF Research Boot Camp April Jeroen Engelberts Consultant Supercomputing

Introduction To Linux. Rob Thomas - ACRC

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Advanced Linux Commands & Shell Scripting

Introduction to UNIX/Linux

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Introduction to Linux

UNIX and Linux Essentials Student Guide

Command-line interpreters

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

EECS2301. Lab 1 Winter 2016

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Unix Workshop Aug 2014

Introduction. File System. Note. Achtung!

Answers to AWK problems. Shell-Programming. Future: Using loops to automate tasks. Download and Install: Python (Windows only.) R

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

Introduction to UNIX. Introduction EECS l UNIX is an operating system (OS). l Our goals:

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Linux for Beginners. Windows users should download putty or bitvise:

New User Tutorial. OSU High Performance Computing Center

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

An Introduction to Cluster Computing Using Newton

unix intro Documentation

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Shell. SSE2034: System Software Experiment 3, Fall 2018, Jinkyu Jeong

Tutorial-1b: The Linux CLI

Basic Linux Command Line Interface Guide

Transcription:

Introduction to Unix The Windows User perspective Wes Frisby Kyle Horne Todd Johansen

What is Unix? Portable, multi-tasking, and multi-user operating system Software development environment Hardware independent History Bell labs, 1969 Distributed to government and academic institutions

What is Unix? Combines smaller programs (shell commands) instead of relying on large individual programs Good tool for distributed processing and multitasking Essential for the development of the Internet and networks

Unix Architecture kernel Core of the operating system Manages computer's hardware shell Command line interpreter Interface between user and kernel Sometimes called terminal Just a program

What's in a kernel? License Pentium vs Athlon Unix vs Linux

Why Use Unix Who uses it? IBM, Sun Microsystems, HP, NEC, SGI Where is it used? Backbone of the Internet Scientific Computing High Performance Computing Video Game Consoles PDAs and Cellphones

Graphical Programs Need X11 Start local X-server Cygwin Xming Exceed

What is X11? Allow for graphical interface Network transparent so a program on a remote machine can be used locally Client-Server design

Starting X-Server

Terminal emulator Secure remote login Free, open source PuTTY

Open PuTTY Session Connection Type Host Name: X11 PuTTY tutorial

Enable X11 Forwarding

Login as: Password: You're ready to work from the command line PuTTY tutorial

WinSCP file transfer protocol (FTP) client for Microsoft Windows Open source Uses similar protocols to PuTTY Can act as a remote editor Can be used simultaneously with PuTTY

Open WinSCP Session Host name: User name: Password: WinSCP tutorial

WinSCP Tutorial Left - local Right - remote Easy click and drag file management Refresh button

Lets talk about the command line

Command Line Requires previous knowledge from user Unfamiliar to many users today No or little mouse support Fastest way to do some things Very good remote connection support Requires only little instruction to be effective

Command line hint: Write down useful commands keep a list

Common Commands ls List directory contents cd Change directory mv Move a file cp Copy a file rm Delete (remove) a file mkdir Create a directory nano Edit a file less Display a file in a scrollable environment

ls List directory contents

Wildcards * matches zero or more charcters ls *.txt list all text files? matches one character

cd Change directory Programing C Fortran kfem Mixed Life test Templates

mv Move a file

cp Copy a file

rm Delete (remove) a file

nano edit a file

Getting help man command - returns a manual for command man ls

More commands Download file unixtut.tar.gz to Windows machine Copy to remote system using WinSCP Extract the files: tar xzvf unixtut.tar.gz We will talk about 'tar' later.

ls - list files Lets view the files that were extracted. $ ls unixtut/* Output: unixtut/lit: poe sonnet1.txt sonnet2.txt sonnet.tx t theraven.txt unixtut/poe: unixtut/sonnets:

mkdir - make directory Lets make a 'shakespeare' directory $ mkdir ~/unixtut/shakespeare

mv - move file Lets move the sonnets folder into the shakespeare folder. $ mv ~/unixtut/sonnets ~/unixtut/shakespeare/

cp - copy Lets copy the sonnets from ~/unixtut/lit/ to ~/unixtut/shakespeare/sonnets/ ~ - means home directory $ cp ~/unixtut/lit/sonnet* ~/unixtut/shakespeare/sonnets/ Lets verify the contents ls ~/unixtut/shakespeare/sonnets/ Output: sonnet1.txt sonnet2.txt sonnet.txt

rm - remove file Lets remove the sonnets in ~/unixtut/lit/ $ rm ~/unixtut/lit/sonnet* Be careful using this command

less - view file Commands arrow key up - one line up arrow key down - one line down f - page down b - page up q - quit $ cd ~/unixtut/shakespeare/sonnets/ ~ - means home directory $ less sonnet.txt

wc - word count Count the number of words in a file. $ wc -w ~/unixtut/lit/sonnet.txt Output: 118 sonnet.txt -w option counts the number of words Count the number of lines in a file $ wc -l ~/unixtut/lit/sonnet.txt Output: 14 sonnet.txt

tail What does it do? Outputs the last part of a file. Default 10 lines. $ tail ~/unixtut/shakespear/sonnets/sonnet.txt

head What does 'head' do? Outputs the first part of a file. Default 10 lines. $ head ~/unixtut/shakespear/sonnets/sonnet.txt

grep What does it do? Searches in files for patterns. Example: Search the unixtut files and print out all lines that have the word 'all' $ grep -r -w all ~/unixtut -r is for recursive search -w is for whole word match Count the number occurrences $ grep -r -w -c all ~/unixtut -c only prints out a count

stdin, stdout, and stderr Input/Output is handles in streams 3 standard streams stdout output stderr error messages stdin input from user

Redirection of stdin, stdout, stderr > file - redirect stdout to file >> file - append stdout to file < file - read file into stdin Example: $ who > users.txt who - prints users logged in $ sort < users.txt sort alphabetically users.txt This could have been done with piping $ who sort

Piping Allows output of one command to be sent as input to the next command Attaches stdout of one process to stdin of another Automation We will come back to this later

Console Multitasking Pause running program with CTRL-Z & put after command to start in background bg run last paused program in background fg run background or paused program in foreground jobs

Example on multitasking Start two xterms in the background $ xterm & xload& xeyes& View the jobs in the background $ jobs Output: [1]- Running xterm & [2]+ Running xterm & fg 1 kill it with ctrl-c fg 2 kill it with ctrl-c

Processes Every user has their own processes. But how do we kill a process?

Example on processes ps - prints a snapshot of processes $ ps -U username o prints processes running by username $ ps -C command o prints process ids (PID) for commands

More Process Examples What if you want to do both? $ ps -U username -C command o Does not work piping and grep to the rescue o $ ps -U username grep command o $ kill PID

ssh What is ssh? Secure, remote login shell Command line, no GUI PuTTY uses this protocol Forward connections through multiple hosts ssh -X username@hostname

scp What is scp? Secure file transfer protocol Also command line Uses ssh From remote computer: scp username@hostname:filename filename To remote computer: scp filename username@hostname:filename

Permissions Each file has an owner user and owner group Actions for user, group, and others

Example on permissions touch file.txt chmod 700 file.txt chmod 755 file.txt chmod u+rwx file.txt chmod g+xr file.txt

tar - archive (zip) Remember $ tar xzvf unixtut.tar.gz? Lets create a tar file of the files in unixtut. o $ cd Takes us to the home directory o $ tar czvf newfiles.tar.gz unixtut View contents and permissions of newfiles.tar.gz o $ tar tzvf newfiles.tar.gz Get more help: o $ man tar

Environmental Variables Start with a '$' Affect the behavior of programs Set using 'export' View all with 'printenv'

Running programs $PATH variable Most programs are in $PATH Current directory is often not in the path use './'

$PATH example What is the current path variable? o echo $PATH Add folder to path o export PATH=$PATH:/folder/

Any Questions? Questions

Text editors Lots of good text editors are available on Unix Syntax highlighting Search abilities Designed with programing in multiple languages in mind kate gedit medit nano vim emacs

kate The KDE Advanced Editor Intuitive Terminal File manager Standard part of KDE

gedit The GNOME editor Intuitive Simple Standard part of GNOME

medit Simple but useful Intuitive Terminal File manager Easy to add tools GTK based, but few dependencies

nano text only, but easy Text only Easy to use Not as feature-rich as emacs or vim

vim hard, but very powerful Many features but only through key commands Found on nearly any Unix machine

emacs like vim, just different Many features Rather hard to learn Standard GNU tool Many extensions

Shell Scripting (Bash) Execute a series of commands in sequence Execute in the Bash shell Automatation Job scripts on supercomputers

echo Commands contained in $() are executed first echo and $()

Aliasing Automatic replacement of one command with another Use certain options all the time

if for Flow Control

#!/bin/bash Sample Shell Script

Building Programs rxvt is an alternative to xterm Will be built from source code

Building Programs (cont)./configure --prefix=$home make install

Building Programs (cont)