1 SEEM3460 Tutorial Unix Introduction. 2 Introduction Unix-like system is everywhere Linux Android for smartphones Google Chrome OS for Chromebook Web.

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

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
1 Introduction to UNIX Ke Liu
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.
1 SEEM3460 Tutorial Access to Unix Workstations in SE.
Virtual Machine and UNIX. What is a VM? VM stands for Virtual Machine. It is a software emulation of hardware. By using a VM, you can have the same hardware.
Unix Workshop Aug What is Unix Multitasking, multiuser operating system Often the OS of choice for large servers, large clusters.
“Linux at the Command Line” Don Johnson of BU IS&T.
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.
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.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Introduction to Linux Workshop February Introduction Rob Lane & The HPC Support Team Research Computing Services CUIT.
The Unix Environment and Compiling. Getting Set Up Your programs will be compiled and tested on the Departmental server ‘linprog’ The linprog servers.
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”
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.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
LINUX Tuesday, 5 July :00 pm. Remote Login l Use Secure Shell (ssh) l Machine name/IP address E.g. ssh hydra.sma.nus.edu.sg Or ssh
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.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
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.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Usage of Workstation Lecturer: Yu-Hao( 陳郁豪 ) Date:
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on.
1 SEEM3460 Tutorial Compiling and Debugging C programs.
Introduction to Programming Using C An Introduction to Operating Systems.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Introduction to UNIX and Linux.  Written by Dennis Ritchie and Ken Thomsom at Bell Labs in 1969  Initially written in assembly language and a high-level.
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.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Learning Unix/Linux Based on slides from: Eric Bishop.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Review Why do we use protection levels? Why do we use constructors?
Tutorial Six Linux Basics CompSci Semester Two 2016.
Overview of Linux Fall 2016 Dr. Donghyun Kim
Introduction to Unix for FreeSurfer Users
Precept I : Lab Environment, Unix, Bash, Emacs
ENEE150 Discussion 01 Section 0101 Adam Wang.
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.
Class Projects and Environment
SEEM3460 Tutorial Unix Introduction.
CS1010: Intro Workshop.
Getting started with CentOS Linux
Chapter 11 Command-Line Master Class
Tutorial Six Recap & Linux Basics CompSci Semester Two 2016.
Andy Wang Object Oriented Programming in C++ COP 3330
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Intro to UNIX System and Homework 1
C Programming Lecture Series
SEEM3460 Tutorial Unix Introduction Xinshi Lin & Zihao Fu
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
Andy Wang Object Oriented Programming in C++ COP 3330
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Yung-Hsiang Lu Purdue University
Video Notes.
Presentation transcript:

1 SEEM3460 Tutorial Unix Introduction

2 Introduction Unix-like system is everywhere Linux Android for smartphones Google Chrome OS for Chromebook Web servers OS X for MacBook/iMac etc iOS for iPhone/iPad etc

3 Unix Shell Shell: a program that acts as a middleman between you and the UNIX OS Terms similar to shell: Terminal / virtual terminal Console A shell allows users to Run programs Manage I/O of processes easily A Unix shell interprets a programming language (sometimes called the shell script)

SSH and X Window System SSH (Secure Shell) to connect to remote machines and execute commands remotely Windows does not support SSH natively, so we need third-party tools like Putty X Window System commonly used in Unix-like systems to provide GUI environment To run GUI program remotely, you need to provide a local X Server We use Xming to start a X Server on Windows 4

5 Required Software (Windows) SSH client (required) PuTTY (FREE) (download putty.exe and plink.exe) PuTTY SSH Communications Security X server (optional, but needed for GUI) Xming (FREE) (download Xming in “Public Domain Releases”) Xming X-Win32

6 Required Software (OS X) SSH client No need, OS X have native support X server XQuartz

7 Available Servers We provides three servers for this class: linux03.se.cuhk.edu.hk linux04.se.cuhk.edu.hk linux05.se.cuhk.edu.hk Inside SE intranet, you may omit “.se.cuhk.edu.hk” part To connect these servers outside SEEM, you need to connect the SEEM VPN ssl.se.cuhk.edu.hk/seem/index.php/Computer_Faciliti es:External_Access_Route:VPN_STEPS ssl.se.cuhk.edu.hk/seem/index.php/Computer_Faciliti es:External_Access_Route:VPN_STEPS

Using Putty (without GUI support) run putty.exe [Session]: Host Name: (e.g.) cuse81 Save for later use Double click the saved session name to start SSH you will get: To close SSH connection, type exit and enter. 8

Using Putty (with GUI support) If you need to run GUI programs like Nautilus, you need to start a local X Server, e.g. Xming. run Xming.exe run putty.exe [Connection]-[SSH]-[X11]: Enable X11 forwarding [Session]: Host Name: (e.g.) cuse81 Save for later use Double click the saved session name to start SSH you will get: 9

Utilities Unix utilities are the basic programs supporting the user to control the system Examples: date: shows the system date man -s 1 ls: shows help on ls from the built-in manual section 1 pwd: prints the working directory echo: prints a message 10

A shell command ls -lp ~ ls: program name “ls” is the utility to list files -lp: options/switches, starting with a hyphen “l” means list in long format “p” means putting a slash after directory names ~: remaining parameters actual meaning depends on the program used for ls, the remaining parameters are the files or directories to be listed “~” means the home directory of the current user 11

12 Unix file system in brief A hierarchy of directories To locate a file in the system, a pathname is needed Command: pwd print your current working directory Pathnames Absolute pathnames Starting from the root (with a beginning “/”) Relative pathnames Starting from the current working directory

Directory: ls, cd, mkdir, rmdir List files in a directory or fits the pattern ls Change working directory cd Creating (making) a directory mkdir 13

File Operations View the content of a file cat less head tail 14

cp, rm, mv Copying a file cp Remove a file rm Remove a non-empty directory rm –r Remove a whole directory without prompt rm –rf Moving (renaming) a file mv 15

16 Editing a file nano Adv: simple, easy to learn and use Dis: no GUI emacs Adv: has GUI, easy for beginners Dis: relatively slow vi/vim (vim stands for Vi Improved) Adv: fast for advance users Dis: text-version is quite difficult to learn GUI version: gvim, rgvim To learn, type “vitutor” in console Check their “man” page for detail usages

17 Compiling C programs in Unix Compiler: cc – the native C compiler under Unix gcc – C compiler under GNU project Usage is the same, gcc is more popular To compile a C source code file, say example.c, type in: gcc example.c The output of both compilers (i.e. the executable) would be “a.out” by default To override the default executable name, use “-o” flag gcc example.c –o example You can name the executable as.exe or.bin file to remind yourself the nature of the file One more tip, use “-Wall” to get some warning messages Warning message usually indicate hidden bugs Try to understand the error messages and warning messages. For other flags, “man cc” or “man gcc”

18 Practices Get familiar with file/directory-related commands Create a seem3460 folder in your home directory In the tutorial-01 folder, create a hello.c file with the following content, compile with gcc and run the compiled program: #include int main() { printf(“Hello World\n”); } Create the reverse.c program, compile and run. See page 6 in Lecture Notes “Compilation and Linking under Unix”. Copy and Paste may produce strange characters in your editor, so try to type the code by yourself.

reverse.c #include void reverse (char before[], char after[]); int main() { char str[100]; /* buffer to hold reversed string */ reverse("cat",str); /* reverse the string "cat" */ printf ("reverse(\"cat\") = %s\n", str); reverse("noon",str); printf ("reverse(\"noon\") = %s\n", str); } void reverse (char before[], char after[]) { int i,j,len; len = strlen(before); i=0; for (j=len-1; j>=0; j--) { after[i] = before[j]; i++; } after[len] = ‘\0’; } 19