Introduction to Linux/UNIX. History UNIX beginnings in 1969 (Linus Torvalds is born!) AT & T Bell Laboratories (Ken Thompson & Dennis Richie) Working.

Slides:



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

Unix. Outline Commands Environment Variables Basic Commands CommandMeaning lslist files and directories ls -alist all files and directories mkdirmake.
1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
©Colin Jamison 2004 Introduction to Linux Colin Jamison.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Basic UNIX Commands Commonly used Unix commands. Read a Text File Head Tail More.
CMPE 151: Network Administration Spring Class Description Focus: system and network administration. Sequence of exercises. E.g., installing/configuring.
1 UNIX essentials (hands-on) the directory tree running programs the shell (using the T-shell) → command line processing → special characters → command.
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 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.
Welcome to CSE  Name: Di Cao   Classroom: DL357  Class Time: T 8:30am - 9:18am  Office.
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.
Linux in More Detail Shirley Moore CPS5401 August 29,
Introduction to UNIX Don Bahls user consultant (907)
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
Introduction to Computer Organization & Systems Topics: Intro to UNIX COMP John Barr.
Linux Un*x Overview Peter Norton’s Guide to Unix Running Linux (O’Reilly)
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 Homework / Exam HW7 is due next class Starting Glass chapter 4 and parts of 7 Exam 3 – Class 26 –Open Book / Open Notes –Up through End of K&R Chapter.
1 Operating Systems Lecture 2 UNIX and Shell Scripts.
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.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
UNIX/LINUX Shells Glass & Ables ch. 5 A picture of the relationship between UNIX shells Common Core Bourne Shell Korn Shell Common Core C Shell T Shell.
Unix/Linux for beginners:
40 Years and Still Rocking the Terminal!
UNIX shell environments CS 2204 Class meeting 4 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
Introduction to Programming Using C An Introduction to Operating Systems.
CSC414 “Introduction to UNIX/ Linux” Lecture 5. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Basic of UNIX For fresh members of SPARCS
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Linux Commands C151 Multi-User Operating Systems.
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.
Lecture 1: Introduction, Basic UNIX Advanced Programming Techniques.
Learning basic Unix command It 325 operating system.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
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.
Unix Basics.
Andy Wang Object Oriented Programming in C++ COP 3330
UNIX Introduction History Main Features UNIX Operating System
Some Linux Commands.
C151 Multi-User Operating Systems
The Linux Operating System
CSE 303 Concepts and Tools for Software Development
Basic UNIX OLC Training.
Introduction to UNIX.
Operating Systems and Using Linux
Introduction to Linux Week 0 - Thursday.
CS 60 Discussion Review.
John Carelli, Instructor Kutztown University
Unix : Introduction and Commands
Introduction to Linux/UNIX
Introduction to Computer Organization & Systems
Operating Systems and Using Linux
Linux Shell Script Programming
Operating Systems and Using Linux
Linux Commands LINUX COMMANDS.
Introduction to Linux Commands
LPI Linux Certification
Presentation transcript:

Introduction to Linux/UNIX

History UNIX beginnings in 1969 (Linus Torvalds is born!) AT & T Bell Laboratories (Ken Thompson & Dennis Richie) Working version (in 1970) on a DEC PDP 11/70 UNIX and C Relationship June 81: Berkeley UNIX 4.1 BSD (enhanced with vi, csh, and virtual memory management) 1983: Berkeley UNIX 4.2 BSD (added TCP/IP networking, sockets and a new file system) Later  UNIX/32V, SYSTEM III, SYSTEM V and  Linux is introduced by Linus B. Torvalds in 1991

GNU Project Launched in 1984 to develop a complete UNIX-like Operating System that is free software Organized by free software foundation Free GNU Software: Usually C code, but some C++ The GNU System provides a collection of applications, libraries, and developer tools, plus a program to allocate resources and talk to the hardware, known as a kernel

Basics Talking to Linux/UNIX  The Shell –displays the prompt for your next command –parses your command input and executes it –several different kinds: Bourne Shell or sh, ksh, csh, and tcsh Setup your environment variables:.bashrc Home directory /user/local/home/YourLoginName Your files are at: /user/local/home/YourLoginName/SDRIVE File/Directory structure  A tree

Useful UNIX/Linux Commands A subset of these commands are: alias/unalias, bg, cat, cc, cd, chmod, cp, csh, diff, du echo, emacs, fg, gcc, grep, history, jobs, kill, ln, logout lpq, lpr, lprm, ls, man, mkdir, more, mv, printenv, ps pwd, rlogin, rm, rmdir, rsh, script, set, setenv, source tail, tar, telnet, touch, unsetenv, vi, wc, which, xterm

More Basics … Consulting the on-line manual  man command Compiling with “gcc” and “g++” I/O Redirection > Redirect output < Redirect input p & Run p in the background (try also jobs, ^Z, bg, fg, ps, and kill) p1 | p2 Pipe output of p1 as input for p2 p >> f Append output of p into file f

Command-line arguments linux01 > myprog filename int main( int argc, char* argv[]) { } argv Myprog \0 filename \0 NULL argc = Text Editing / data compression GNU emacs (/usr/bin/emacs) vi (/usr/bin/vim) /bin/gzip /bin/gunzip

Writing Simple Shell Scripts Bourne Shell Programming (bash – standard Linux shell) Example: #!/usr/bin/env bash echo name of script is $0 echo first argument is $1 echo second argument is $2 echo third argument is $3 echo eleventh argument is $11 echo number of arguments is $#

More examples… Example 1: Remove "Cntl-M" from a given file Example 2: Keep track of users every 20 seconds Example 3: List all files in all subdirectories recursively Example 4: List and count all files in all subdirectories

Linux/UNIX Processes ps –acefl | more ps –acefl | grep “init” the first, primordial process  init PID=1 PPID=0 (kernel) All other processes are descendants of init. Each process has only one parent but could have many children Child processes inherit the environment of the parent process All programs start with three files open: stdin, stdout, stderr

Linux/UNIX Process Model Process Attributes A unique process identifier (PID) - getpid() call parent process (PPID) – getppid() call permission identifiers (UID, GID etc.) An address space A current working directory (.) A set of open files, directories environment variables – env or printenv (e.g. PATH= …; HOME=…) scheduling priority

make facility used for maintaining component modules in a software system. The default file for make is called makefile or Makefile. Otherwise, use “make –f filename” A makefile consists of a series of sections each composed of target, dependencies and commands. Example : Every command line must begin with a tab. make target returns without doing anything if no changes are made to any of the files involved in making the target.

makefile #A simple Makefile example default: all all: driver driver: program.o \ "Building g++ program.o scanner.o -o driver program.o: parser.h symbol.h \ program.cpp g++ -c program.cpp scanner.o: scanner.h \ scanner.cpp g++ -c scanner.cpp clean : rm driver program.o scanner.o