1 Introduction to UNIX Ke Liu

Slides:



Advertisements
Similar presentations
UNIX Overview. 2 UNIX UNIX is a multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Example: different.
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX – The Process The Process A process is.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
1 Introduction to UNIX 2 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.
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
1 Basics of Linux On linux machine: Login at your home directory Open a “shell” or “terminal” or “xterm” workspace (4) On windows machine Intall linux.
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
UNIX Overview. 2 UNIX UNIX is a multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Multi-user: different.
7/17/2009 rwjBROOKDALE COMMUNITY COLLEGE1 Unix Comp-145 C HAPTER 2.
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.
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.
Systems Programming Concepts
Learning basic Unix command IT 325 operating system.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
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.
Introduction to Unix Bent Thomsen Institut for Datalogi Aalborg Universitet.
Lesson 1. PC vs. Multi-user System  Personal Computer – each user gets his/her own processor (or multicore processor).  Multi-user system – The processor,
Introduction to UNIX Don Bahls user consultant (907)
Introduction to Computer Organization & Systems Topics: Intro to UNIX COMP John Barr.
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
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 Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
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 UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
November 5, 2015CIS 118 Intro to UNIX What’s a Unix? Unix is an Operating System Designed for high-traffic usage Many variants –Linux, BSD: free versions.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Introduction to Programming Using C An Introduction to Operating Systems.
Getting Started UNIX InKwan Yu Topics Unix Commands Unix System calls C function calls.
Linux Commands C151 Multi-User Operating Systems.
1 CS3695/M6-109 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
A gentle introduction to LINUX at the command prompt.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
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.
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.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
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  There are many different.
Lecture 1: Introduction, Basic UNIX Advanced Programming Techniques.
ICE UNIX TUTORIAL. File System Commands cd – change directory cd – change directory ls – list contents ls – list contents rm – remove/delete rm – remove/delete.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
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.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
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.
Getting started with CentOS Linux
CS3695/M6-109 – Network Vulnerability Assessment & Risk Mitigation –
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
Introduction to UNIX.
Unix : Introduction and Commands
Web Programming Essentials:
A Brief Overview of Unix
Introduction to Computer Organization & Systems
Introduction Paul Flynn
Getting started with CentOS Linux
Andy Wang Object Oriented Programming in C++ COP 3330
Linux Shell Script Programming
Linux Commands LINUX COMMANDS.
Presentation transcript:

1 Introduction to UNIX Ke Liu

2 Topics. Logging in. Unix Shells and useful shell commands. File System in Unix. Program, Process and Process control. Inter-process communication. Compiling and debugging C programs. Editors.

3 UNIX UNIX is multi-user and multi-tasking operating system. Multi-tasking: Multiple processes can run concurrently. Example, different users can read mails, copy files, and print all at once.

4 Logging In Enter login name and password ! System password file: /etc/passwd (usually). You can change password using the command: passwd.

5 Shell After a successful login, the shell program is run. The default shell of bingsuns: tcsh bingsun2% ps PID TTY TIME CMD 2159 pts/2 0:00 tcsh Shell is a command line interpreter that reads user commands and executes them.

6 Unix Shells Common Shells: Bourne shell, the C shell, and the Korn shell. The shell on bingsuns is tcsh (tc shell). Users can switch between shells, using the commands bash, csh, ksh, sh. Control D (^d) to return back to original shell, or just use the command: exit.

7 Some shell commands Most Important command: man (manual pages). Help: unix commands, C functions. Usage: man Try “man man” ! Example: man ls, man passwd, man printf.

8 Some shell commands (cont’) pwd: working directory (/u0/users/2/kliu1). ls: list contents of directory mkdir : make directory rmdir : remove an empty directory rm –r : remove a directory with all the contents cd : change directory, ~/ means your home directory cp : copy command.

9 Some shell commands (cont’) chmod : change mode of a file/directory ls –l : long list with details 9 permission bits: d r w x r w x r w x 3 categories: user/group/all. Permissions: read/write/execute (r/w/x). E.g.: mode= 644 means r w _ r_ _ r _ _ command: chmod 644 first 3 bits for user. Next group. Next all others.

10 Some shell commands (cont’) rm : remove files e.g.: rm –fr directory/filename mv : change the name of a file Pipes: Connect the stdout of one command with the stdin of another command e.g.: ls -l | more or ls –l | less

11 File System Hierarchical arrangement of files and directories. Top level: root or / e.g.: cd /. Current directory,.. One level higher directory e.g.: cd. No change for it is current directory or cd.. Change to parent directory.

12 File System (cont’) Pathname: absolute and relative. Absolute pathname: /u0/users/2/kliu1 Relative pathname: abc.

13 Editors. Different editors: emacs, pico, vi emacs pico vi

14 The easiest editor: pico or nano pico Full screen editor Help on the bottom of the screen The nano is an extension to the pico

15 Basic operations in pico Ctrl + v : to move page down Ctrl + y : to move page up Ctrl + o : to save the current buffer Ctrl + x : to exit with or without saving Ctrl + g : to get help Ctrl + r : to open a file Ctrl + w : to find a string in the current buffer Ctrl + c : to get the current position in the buffer

16 Program & Process Program is an executable file that resides on the disk. Process is an executing instance of a program. A Unix process is identified by a unique non-negative integer called the process ID. Check process status using the “ps” command.

17 Foreground/background processes A program run using the ampersand operator “&” creates a background process. E.g.: bingsun2% back & otherwise it creates a foreground process. E.g.: bingsun2% back

18 Foreground/background processes Only 1 foreground process for each session. Multiple background processes. Where are background processes used? All system daemons, long user processes, etc. e.g. printer-daemon process or mailer-daemon process. These processes are always running in background. Pine is foreground process.

19 Process Status bingsun2% back & [1] the process id assigned by system bingsun2% ps PID TTY TIME CMD 1973 pts/39 0:01 tcsh pts/39 0:00 back

20 How to stop a process? Foreground processes can generally be stopped by pressing CONTROL C (^C). Background processes can be stopped using the kill command. Usage: kill SIGNAL kill -9 (-9 means no blocked) Or kill. If a foreground process is not stopping by ^C, you can open another session and use the kill command.