Systems Programming/ C and UNIX
|
|
- Randall Bruce
- 5 years ago
- Views:
Transcription
1 Systems Programming/ C and UNIX Alice E. Fischer September 6, 2017 Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
2 Outline 1 Booting into Linux 2 The Command Shell 3 Defining a Command Language Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
3 Booting into Linux Booting into Linux The BIOS The bootdisk The boot sector The boot loader The kernel Run systemd Install system services Open a desktop or shell Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
4 Booting into Linux Start in the BIOS: Find and read the boot sector. The Basic Input/Output System is stored in the compute s firmware. Run the POST (Power On Self Test) to ensure that the hardware components have been initialized correctly. The order in which to search for devices is controlled by a configuration file. Locate the first attached device that has a boot sector. The boot program must be very small because it AND the partition table must fit into the first 512-byte sector on the boot device. Load that boot sector into RAM and transfer control to it. It loads the next stage of the boot loader, called GRUB. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
5 Booting into Linux Read, execute the boot loader The current Linux bootloader is GRUB2: GRand Unified Bootloader 2 GRUB2 is located between the end of the boot sector and the first partition on the disk drive. This space is 31,744 bytes long ( byte sectors). It is just smart enough to find the kernel and load it into memory. This code contains a few common dilesystem drivers (EXT, FAT, NTFS). There are always at least two versions of the Linux kernel on the disk: the newest one and the prior version. The prior version is there to revert to when the new one.did not install correctly or has a bug. GRUB allows the user to choose from among several kernel images or foreign OS kernels. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
6 Booting into Linux Read and decompress the kernel, give it control. The files for Stage 2 of the boot loader are stored in /boot/grub2 and its subdirectories. The code consists mostly of runtime kernel modules, loaded as needed. It lets the user select which kernel to load. GRUB stage 2 loads the selected kernel into memory and turns control over to it. All of the kernels are in a self-extracting, compressed format to save space. When the kernel begins running, its first job is to extract the full code from the compressed format. When extraction is done, the kernel runs systemd, which starts up and initializes the session. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
7 Booting into Linux Run systemd. This initialization code was formerly, this was called init. It is the mother of all processes and is responsible for making the host machine ready to use. A configuration file lists the required services. This typically includes: Mounting the filesystems. Starting system daemons (sshd, cupsd, xinetd, crond, named, systemd-logind, apcupsd, etc. ) Starting system services (the Xorg server, postgress server, mail server, power manager) Presenting a login window. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
8 The Command Shell More on the Command Shell Quotes Compiling Commands Search Paths Changing your Environment Shell Resource Files Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
9 The Command Shell More on the Command Shell When you log into the system, or double-click your terminal-window icon, Unix will create a shell process for you. It executes in your user space, not kernel space This process displays a prompt in the window and waits for you to enter a command. It then reads and parses your command line. The shell will look at the directories in your search path to find a shell script or executable program that matches your command name. The first match, from the left end of the search path, will be used. The shell then forks off another process to execute your command, and sends the argc and argv that you typed to your new process. When your process finishes, control returns to your shell process and it displays another command prompt. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
10 The Command Shell Quotes: bash shell Quoting removes the special meaning, to the shell, of special characters and reserved words. It can be used to prevent parameter expansion. There are three mechanisms: the escape character (\), single quotes, and double quotes. The escape character is a backslash. It preserves the literal value of the following char. A \<newline> is treated as a line continuation. Enclosing characters in single quotes preserves the literal value of each character. A single quote may not occur between single quotes. Enclosing characters in double quotes is trickier. It preserves the literal value of characters within the quotes, with many exceptions and special cases. Use it for scripting and to quote single quotes. "You can t do this with single quotes." You can \ t do this with single quotes. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
11 The Command Shell Compiling Commands Compile-time search path (open log.txt, search for... ). Preprocess only: c++ -E mycode.cpp Compile only (don t link): c++ -c mycode.cpp Compile and link all: c++ -o mycommand -std=c++14 mycode.cpp mypackage.cpp Compile and link in C: cc -o mycommand mycode.c mypackage.c Load and run a program:./mycommand [any necessary switches and arguments] Load and run if you have extended your path: mycommand [any necessary switches and arguments] Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
12 The Command Shell Useful C/C++ flags: -E: Preprocess only -c : Compile only (don t link) -Wall : display all warnings (highest level of warnings) -v : verbose; print all commands used during compilation. --version : Display version number and copyright information for your compiler. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
13 The Command Shell The Environment Your environment is a set of strings that is global to your processes. It contains varied information about you and your hardware, and it influences many things. An initial set of definitions and settings is installed when you install your system. However, you can add to that set of definitions by using a.bashrc file. When the.bashrc file EXPORTs something, it goes into the environment and will be inherited by all commands executed in that shell. PATH, your list of search paths, is defined in the environment. When you use a shell to execute a command, the shell s environment is inherited by the shell process it forks off. This new process executes in the same environment as its parent shell. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
14 The Command Shell Understanding your Environment Typically, each string in the environment has the form NAME=setting. Within a program, you can access the environment using getenv() or through the global variable char** environ. You may create a new environment variable in a shell: setenv name value (tcsh) or export name=value (bash) You may remove an environment variable: unsetenv( name ) (tcsh) or unset name (bash) Example: Add the working directory to your search PATH: bash-3.2$ PATH=$PATH:. bash-3.2$ export PATH Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
15 The Command Shell Search Paths When you execute a command from the shell, the shell-process must find the definition of that command on your machine. To do so, it uses a search path that was loaded when you logged on. The search path lists several directories on your machine where shell scripts and executable code are stored. Initially, the search path lists the directories used for executables when the system was installed. To see your current search path in your environment, type this: echo "$PATH" printenv PATH Type a $ in front of the name of an environment variable or a shell variable to get its value. My current search path is: /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/x11/bin Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
16 The Command Shell Search Paths Continued There is no special place for storing the UNIX commands. Each installation will have a default search path that is appropriate for the way its resources are organized. Built-in commands are typically found in these places: /bin: the most fundamental commands. /usr/bin: most commands and utility programs. /sbin: commands for system administrators. Some commands are built into the shell. Initially, your current working directory is NOT on the search path. To execute a command you just compiled, you need to change the search path or specify the current working directory as part of the command name:./mycommand myarg1 myarg2 Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
17 The Command Shell Changing your environment. A UNIX system has a predefined standard environment that defines a long list of basic variables, including who you are and what shell you use. Environment variables have upper-case names like One of those is PATH, your default search path. To see your environment, type printenv LOGNAME, USER In addition, your shell will load a resource file each time you open a shell window. The result will be that all the default variables are loaded first, followed by the ones you defined. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
18 The Command Shell Creating a Shell Resource File If you have never created your own shell resource file, you don t have one. Instead, the default profile will be used when you open a shell Use a text editor to create your own resource file, then store the file in your home directory with the name.bashrc (or.cshrc). If you have trouble giving the correct name to this file, create a file in your home directory with any name, then use the shell and the mv command to change the name. Thereafter, the commands in this file will be loaded for you every time you open a new shell. To see this file in a shell, execute cd to go to your home directory, then type cat.bashrc Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
19 Defining a Command Language Defining a Command Language Each application defines its own commands Use getopt() to analyze the argument vector Defining short and long options Using getopt_long() Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
20 Defining a Command Language Each Application Defines its own Legal Commands A program receives an argument vector, entered by the user, when it begins execution. Every program knows its own needs. Many programs do not take input from the command line. Some programs require arguments to work. Some have optional arguments, in addition to or instead of required ones. The first thing a program must do is determine whether it has enough command line arguments and whether they make sense. If not, it must print a usage comment to inform the user of the problem and possible solutions. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
21 Defining a Command Language Use getopt() to Analyze the Argument Vector. Command shells provide tools for extracting the switches, or options, and their parameters from argv. Without automation, this is an annoying and picky job because of the need for validation and for handling errors. The getopt function automates the process. int getopt( int argc, char* argv[], const char* opts ); argc and argv are the parameters received from the shell by your program. opts is a string containing all the short switch options that your program supports: "i:avrou" An option letter followed by a colon requires a parameter. An option letter followed by a double colon has an optional parameter. Your program uses getopt() to read and validate the switches that are present. Then it must store that information in its own variables. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
22 Defining a Command Language Using getopt(): options.c. for (;;) { ch = getopt(argc, argv, "i:-abrou"); if( ch == -1 ) break;... getopt() returns the next known option character in the optstring. It will search argv for all the switches in the command line. Each time you call it, the next switch will be returned. (This is a char, even though the type is technically int.) The order of the items on the command line will be changed so that all the non-switch arguments follow all the switches. The global variable optind contains the subscript of the first non-option argument. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
23 Defining a Command Language getopt() Return Values On return from getopt(), optarg points to an option argument, if it is expected, optind contains the index to the next argv argument for a subsequent call to getopt(). optopt saves the last known option character returned by getopt(). getopt() function returns -1 when the argument list is exhausted. If getopt()encounters a character not found in optstring or if it detects a missing option argument, it returns? (question mark). optopt is set to the character that caused the error. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
24 Defining a Command Language Defining short and long Options Each program defines its own command language. A string defines the short switches: "i:avrou" A structure is used for the long switches. struct option longopts[] = { { "verbose", no_argument, NULL, b }, { "output", required_argument, NULL, o }, { "recursive", no_argument, NULL, 0 }, { "debug", optional_argument, NULL, 0 }, { NULL, 0, NULL, 0 } }; The last line of the structure must be a row of 0 s. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
25 Defining a Command Language Using getopt_long() and getopt_long_only(). This function extends the old getopt() by allowing long switches with single dashes. Many long switches are equivalent to one-letter switches; many are not. int getopt_long_only( int argc, char* argv[], const char* optstring struct option longopts[], int* codep ); longopts is a table containing all the information about long switches. If there is a short equivalent for the long switch, that char will be returned (otherwise 0). If not, the subscript of the correct line of longopts will be stored in codep. If a switch requires an argument, it may be preceded by either an = or a space. An optional argument must be preceded an =. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
26 Defining a Command Language Errors with getopt() and getopt_long_only(). Technically, all of the switches are supposed to precede all of the non-switch arguments. If you write them in the wrong order, getopt() and getopt_long_only() will change the order to put non-switches at the end. Invalid switch name: If a switch is on the command line but NOT in the set of defined switches, getopt() returns? as an error code. Your program must check for and handle the error. It is customary to output a usage message when the form of the command line is wrong. If a required switch argument is missing, the next thing on the command line will be taken as its argument. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
27 Defining a Command Language The getopt_long() Demo Program. options.c Lines to look at: Line 6 includes the header file for getopt_long(). Lines 14 through 20 define the set of long switches. The columns in the table are: the switch name argument-requirements an alternate way to return the option, and the equivalent option letter, or zero. The loop on lines processes the options returned by getopt_long(). Use a switch statement to process your options. My switch statement handles four different kinds of cases. In this program, all I do is print the switch information. However, normally, each case would set a boolean flag-variable to indicate that the switch is on, and process switch-arguments appropriately. Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
28 Defining a Command Language Homework P1 In the man pages, look up ten commands from the list below. Choose unfamiliar commands, and choose two from each column. Turn in a 1-sentence description of what each command is used for. alias awk cal last uname cat cd chmod chown which cp diff df emacs file finger gcc grep gzip strings kill less ln ls xxd mkdir more mv passwd man ps pwd rm rsync ping whoami sort ssh stat head sudo slogin svn touch tail touch uniq wc who uptime Alice E. Fischer Systems Programming Lecture /28 September 6, / 28
Introduction to Supercomputing
Introduction to Supercomputing TMA4280 Introduction to UNIX environment and tools 0.1 Getting started with the environment and the bash shell interpreter Desktop computers are usually operated from a graphical
More informationChapter-3. Introduction to Unix: Fundamental Commands
Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system
More informationLinux Command Line Primer. By: Scott Marshall
Linux Command Line Primer By: Scott Marshall Draft: 10/21/2007 Table of Contents Topic Page(s) Preface 1 General Filesystem Background Information 2 General Filesystem Commands 2 Working with Files and
More informationSystems Programming/ C and UNIX
Systems Programming/ C and UNIX Alice E. Fischer Lecture 6: Processes October 9, 2017 Alice E. FischerLecture 6: Processes Lecture 5: Processes... 1/26 October 9, 2017 1 / 26 Outline 1 Processes 2 Process
More informationLaboratory 1 Semester 1 11/12
CS2106 National University of Singapore School of Computing Laboratory 1 Semester 1 11/12 MATRICULATION NUMBER: In this lab exercise, you will get familiarize with some basic UNIX commands, editing and
More informationExercise 1: Basic Tools
Exercise 1: Basic Tools This exercise is created so everybody can learn the basic tools we will use during this course. It is really more like a tutorial than an exercise and, you are not required to submit
More informationIntroduction to Unix: Fundamental Commands
Introduction to Unix: Fundamental Commands Ricky Patterson UVA Library Based on slides from Turgut Yilmaz Istanbul Teknik University 1 What We Will Learn The fundamental commands of the Unix operating
More informationIntroduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines
Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical
More informationGNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018
GNU/Linux 101 Casey McLaughlin Research Computing Center Spring Workshop Series 2018 rccworkshop IC;3df4mu bash-2.1~# man workshop Linux101 RCC Workshop L101 OBJECTIVES - Operating system concepts - Linux
More informationTable 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
Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing
More information3/8/2017. Unix/Linux Introduction. In this part, we introduce. What does an OS do? Examples
EECS2301 Title Unix/Linux Introduction These slides are based on slides by Prof. Wolfgang Stuerzlinger at York University Warning: These notes are not complete, it is a Skelton that will be modified/add-to
More informationUnix Introduction to UNIX
Unix Introduction to UNIX Get Started Introduction The UNIX operating system Set of programs that act as a link between the computer and the user. Developed in 1969 by a group of AT&T employees Various
More informationOverview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions
Lanka Education and Research Network Linux Architecture, Linux File System, Linux Basic Commands 28 th November 2016 Dilum Samarasinhe () Overview History of Linux Linux Architecture Linux File System
More informationPerl and R Scripting for Biologists
Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications
More informationINF322 Operating Systems
Galatasaray University Computer Engineering Department INF322 Operating Systems TP01: Introduction to Linux Ozan Çağlayan ocaglayan@gsu.edu.tr ozancaglayan.com Fundamental Concepts Definition of Operating
More informationTable Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands
Table Of Contents 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands Getting onto the Zoo Type ssh @node.zoo.cs.yale.edu, and enter your netid pass when prompted.
More informationShell Programming Overview
Overview Shell programming is a way of taking several command line instructions that you would use in a Unix command prompt and incorporating them into one program. There are many versions of Unix. Some
More informationComputer Systems and Architecture
Computer Systems and Architecture Stephen Pauwels Computer Systems Academic Year 2018-2019 Overview of the Semester UNIX Introductie Regular Expressions Scripting Data Representation Integers, Fixed point,
More informationbash, part 3 Chris GauthierDickey
bash, part 3 Chris GauthierDickey More redirection As you know, by default we have 3 standard streams: input, output, error How do we redirect more than one stream? This requires an introduction to file
More informationCSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80
CSE 303 Lecture 2 Introduction to bash shell read Linux Pocket Guide pp. 37-46, 58-59, 60, 65-70, 71-72, 77-80 slides created by Marty Stepp http://www.cs.washington.edu/303/ 1 Unix file system structure
More informationSep 12, 2006 Lecture 2: System Programming
Sep 12, 2006 Lecture 2: System Programming September 19, 2007 1 Introduction In this lecture, we will introduce the basics of systems programming using the language of choice C language. We also introduce
More informationUNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo
UNIX COMMANDS AND SHELLS UNIX Programming 2015 Fall by Euiseong Seo What is a Shell? A system program that allows a user to execute Shell functions (internal commands) Other programs (external commands)
More informationUnix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011
Unix/Linux Operating System Introduction to Computational Statistics STAT 598G, Fall 2011 Sergey Kirshner Department of Statistics, Purdue University September 7, 2011 Sergey Kirshner (Purdue University)
More informationList of Linux Commands in an IPm
List of Linux Commands in an IPm Directory structure for Executables bin: ash cpio false ln mount rm tar zcat busybox date getopt login mv rmdir touch cat dd grep ls perl sed true chgrp df gunzip mkdir
More informationSome useful UNIX Commands written down by Razor for newbies to get a start in UNIX
Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX 15th Jan. 2000 / 3:55 am Part 1: Working with files and rights ------------------------------------- cp
More informationEECS 2031E. Software Tools Prof. Mokhtar Aboelaze
EECS 2031 Software Tools Prof. Mokhtar Aboelaze Footer Text 1 EECS 2031E Instructor: Mokhtar Aboelaze Room 2026 CSEB lastname@cse.yorku.ca x40607 Office hours TTH 12:00-3:00 or by appointment 1 Grading
More information5/20/2007. Touring Essential Programs
Touring Essential Programs Employing fundamental utilities. Managing input and output. Using special characters in the command-line. Managing user environment. Surveying elements of a functioning system.
More informationReview of Fundamentals. Todd Kelley CST8207 Todd Kelley 1
Review of Fundamentals Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 GPL the shell SSH (secure shell) the Course Linux Server RTFM vi general shell review 2 These notes are available on
More informationReview of Fundamentals
Review of Fundamentals 1 The shell vi General shell review 2 http://teaching.idallen.com/cst8207/14f/notes/120_shell_basics.html The shell is a program that is executed for us automatically when we log
More informationCommand-line interpreters
Command-line interpreters shell Wiki: A command-line interface (CLI) is a means of interaction with a computer program where the user (or client) issues commands to the program in the form of successive
More informationLecture # 2 Introduction to UNIX (Part 2)
CS390 UNIX Programming Spring 2009 Page 1 Lecture # 2 Introduction to UNIX (Part 2) UNIX is case sensitive (lowercase, lowercase, lowercase) Logging in (Terminal Method) Two basic techniques: 1. Network
More informationUnix System Architecture, File System, and Shell Commands
Unix System Architecture, File System, and Shell Commands Prof. (Dr.) K.R. Chowdhary, Director COE Email: kr.chowdhary@iitj.ac.in webpage: http://www.krchowdhary.com JIET College of Engineering August
More informationUnix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University
Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 5 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 User Operating System Interface - CLI CLI
More informationOutline. Structure of a UNIX command
Outline Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission (owner, group, rwx) File and directory
More informationBIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:
BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: This course provides Bioinformatics students with the
More informationCS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater)
CS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater) 28 January 2013 Jason Yosinski Original slides available under Creative Commons Attribution-ShareAlike 3.0
More informationIntroduction to the UNIX command line
Introduction to the UNIX command line Steven Abreu Introduction to Computer Science (ICS) Tutorial Jacobs University s.abreu@jacobs-university.de September 19, 2017 Overview What is UNIX? UNIX Shell Commands
More informationUnix Tools / Command Line
Unix Tools / Command Line An Intro 1 Basic Commands / Utilities I expect you already know most of these: ls list directories common options: -l, -F, -a mkdir, rmdir make or remove a directory mv move/rename
More informationThe Online Unix Manual
ACS-294-001 Unix (Winter Term, 2018-2019) Page 14 The Online Unix Manual Unix comes with a large, built-in manual that is accessible at any time from your terminal. The Online Manual is a collection of
More informationIntroduction to Linux. Fundamentals of Computer Science
Introduction to Linux Fundamentals of Computer Science Outline Operating Systems Linux History Linux Architecture Logging in to Linux Command Format Linux Filesystem Directory and File Commands Wildcard
More informationOperating Systems. Copyleft 2005, Binnur Kurt
3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.
More informationIntroduction 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 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. 2 Conventions Used in This Book p. 2 Introduction to UNIX p. 5 An Overview
More informationLinux at the Command Line Don Johnson of BU IS&T
Linux at the Command Line Don Johnson of BU IS&T We ll start with a sign in sheet. We ll end with a class evaluation. We ll cover as much as we can in the time allowed; if we don t cover everything, you
More informationOperating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing
Content 3 Operating Systems The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail. How to log into (and out
More informationUtilities. September 8, 2015
Utilities September 8, 2015 Useful ideas Listing files and display text and binary files Copy, move, and remove files Search, sort, print, compare files Using pipes Compression and archiving Your fellow
More informationIntroduction to Linux
Introduction to Linux Mukesh Pund Principal Scientist, NISCAIR, New Delhi, India History In 1969, a team of developers developed a new operating system called Unix which was written using C Linus Torvalds,
More informationCSC UNIX System, Spring 2015
CSC 352 - UNIX System, Spring 2015 Study guide for the CSC352 midterm exam (20% of grade). Dr. Dale E. Parson, http://faculty.kutztown.edu/parson We will have a midterm on March 19 on material we have
More informationOn successful completion of the course, the students will be able to attain CO: Experiment linked. 2 to 4. 5 to 8. 9 to 12.
CIE- 25 Marks Government of Karnataka Department of Technical Education Bengaluru Course Title: Linux Lab Scheme (L:T:P) : 0:2:4 Total Contact Hours: 78 Type of Course: Tutorial, Practical s & Student
More informationIntroduction: What is Unix?
Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix
More informationVi & Shell Scripting
Vi & Shell Scripting Comp-206 : Introduction to Week 3 Joseph Vybihal Computer Science McGill University Announcements Sina Meraji's office hours Trottier 3rd floor open area Tuesday 1:30 2:30 PM Thursday
More informationUNIX Essentials Featuring Solaris 10 Op System
A Active Window... 7:11 Application Development Tools... 7:7 Application Manager... 7:4 Architectures - Supported - UNIX... 1:13 Arithmetic Expansion... 9:10 B Background Processing... 3:14 Background
More informationSystems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab
Systems Programming and Computer Architecture (252-0061-00) Exercise Session 01 Data Lab 1 Goal Get familiar with bit level representations, C and Linux Thursday, September 22, 2016 Systems Programming
More informationEECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou
EECS 2031 - Software Tools Lab 2 Tutorial: Introduction to UNIX/Linux Tilemachos Pechlivanoglou (tipech@eecs.yorku.ca) Sep 22 & 25, 2017 Material marked with will be in your exams Sep 22 & 25, 2017 Introduction
More informationLab 2: Linux/Unix shell
Lab 2: Linux/Unix shell Comp Sci 1585 Data Structures Lab: Tools for Computer Scientists Outline 1 2 3 4 5 6 7 What is a shell? What is a shell? login is a program that logs users in to a computer. When
More informationLinux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester
Linux Essentials Programming and Data Structures Lab M Tech CS First Year, First Semester Adapted from PDS Lab 2014 and 2015 Login, Logout, Password $ ssh mtc16xx@192.168.---.--- $ ssh X mtc16xx@192.168.---.---
More informationhash Remember the full pathname of a name argument head Output the first part of file(s) history Command History hostname Print or set system name
LINUX Commands alias Create an alias apropos Search Help manual pages (man -k) awk Find and Replace text, database sort/validate/index break Exit from a loop builtin Run a shell builtin bzip2 Compress
More informationFilesystem Hierarchy Operating systems I800 Edmund Laugasson
Filesystem Hierarchy Operating systems I800 Edmund Laugasson edmund.laugasson@itcollege.ee There has been used materials from Margus Ernits, Katrin Loodus when creating current slides. Current document
More informationReview of Fundamentals. Todd Kelley CST8207 Todd Kelley 1
Review of Fundamentals Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 The CST8207 course notes GPL the shell SSH (secure shell) the Course Linux Server RTFM vi general shell review 2 Linux
More informationWelcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions
Welcome to getting started with Ubuntu 12.04 Server. This System Administrator Manual guide to be simple to follow, with step by step instructions with screenshots INDEX 1.Installation of Ubuntu 12.04
More informationCS4350 Unix Programming. Outline
Outline Unix Management Files and file systems Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission
More informationLinux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage
Linux+ Guide to Linux Certification, Third Edition Chapter 2 Linux Installation and Usage Objectives Install Red Hat Fedora Linux using good practices Outline the structure of the Linux interface Enter
More informationLinux Systems Administration Getting Started with Linux
Linux Systems Administration Getting Started with Linux Network Startup Resource Center www.nsrc.org These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International
More informationIntroduction to Linux
Introduction to Linux University of Bristol - Advance Computing Research Centre 1 / 47 Operating Systems Program running all the time Interfaces between other programs and hardware Provides abstractions
More informationEmbedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island
Embedded Linux Systems Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Generic Embedded Systems Structure User Sensors ADC microcontroller
More informationAppendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.
Appendix A GLOSSARY SYS-ED/ Computer Education Techniques, Inc. $# Number of arguments passed to a script. $@ Holds the arguments; unlike $* it has the capability for separating the arguments. $* Holds
More informationLinux. An introduction. Aurélien Villani 01/2018
Linux An introduction Aurélien Villani 01/2018 Linux? 2 References Somewhere on the baie-lgf, are some Linux books. 3 Linux? A kernel... 1991: released by Linus Torvalds, for fun 1993: 100 developers working
More informationComputer Systems and Architecture
Computer Systems and Architecture Introduction to UNIX Stephen Pauwels University of Antwerp October 2, 2015 Outline What is Unix? Getting started Streams Exercises UNIX Operating system Servers, desktops,
More informationThe Unix Shell & Shell Scripts
The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises
More informationShell Scripting. With Applications to HPC. Edmund Sumbar Copyright 2007 University of Alberta. All rights reserved
AICT High Performance Computing Workshop With Applications to HPC Edmund Sumbar research.support@ualberta.ca Copyright 2007 University of Alberta. All rights reserved High performance computing environment
More informationIntroduction to Linux. Roman Cheplyaka
Introduction to Linux Roman Cheplyaka Generic commands, files, directories What am I running? ngsuser@ubuntu:~$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu
More informationCS 460 Linux Tutorial
CS 460 Linux Tutorial http://ryanstutorials.net/linuxtutorial/cheatsheet.php # Change directory to your home directory. # Remember, ~ means your home directory cd ~ # Check to see your current working
More informationCourse 144 Supplementary Materials. UNIX Fundamentals
Course 144 Supplementary Materials UNIX Fundamentals 1 Background to UNIX Command Fundamentals This appendix provides a overview of critical commands and concepts Prerequisite knowledge attendees should
More informationLinux Command Line Interface. December 27, 2017
Linux Command Line Interface December 27, 2017 Foreword It is supposed to be a refresher (?!) If you are familiar with UNIX/Linux/MacOS X CLI, this is going to be boring... I will not talk about editors
More informationCS197U: A Hands on Introduction to Unix
CS197U: A Hands on Introduction to Unix Lecture 11: WWW and Wrap up Tian Guo University of Massachusetts Amherst CICS 1 Reminders Assignment 4 was graded and scores on Moodle Assignment 5 was due and you
More informationCSE 391 Lecture 5. Intro to shell scripting
CSE 391 Lecture 5 Intro to shell scripting slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/391/ 1 2 Lecture summary basic script syntax and running
More informationPlease choose the best answer. More than one answer might be true, but choose the one that is best.
Introduction to Linux and Unix - endterm Please choose the best answer. More than one answer might be true, but choose the one that is best. SYSTEM STARTUP 1. A hard disk master boot record is located:
More informationTestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103
TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103 CompTIA Linux+ Powered by LPI LX0-103 Objectives The Linux+ Powered by LPI Exam: LX0-103 exam covers the following topics. #
More informationCOMS 6100 Class Notes 3
COMS 6100 Class Notes 3 Daniel Solus September 1, 2016 1 General Remarks The class was split into two main sections. We finished our introduction to Linux commands by reviewing Linux commands I and II
More informationLinux Shell Scripting. Linux System Administration COMP2018 Summer 2017
Linux Shell Scripting Linux System Administration COMP2018 Summer 2017 What is Scripting? Commands can be given to a computer by entering them into a command interpreter program, commonly called a shell
More informationINTRODUCTION TO LINUX
INTRODUCTION TO LINUX REALLY SHORT HISTORY Before GNU/Linux there were DOS, MAC and UNIX. All systems were proprietary. The GNU project started in the early 80s by Richard Stallman Goal to make a free
More informationChapter 4. Unix Tutorial. Unix Shell
Chapter 4 Unix Tutorial Users and applications interact with hardware through an operating system (OS). Unix is a very basic operating system in that it has just the essentials. Many operating systems,
More informationCENG 334 Computer Networks. Laboratory I Linux Tutorial
CENG 334 Computer Networks Laboratory I Linux Tutorial Contents 1. Logging In and Starting Session 2. Using Commands 1. Basic Commands 2. Working With Files and Directories 3. Permission Bits 3. Introduction
More informationWorking with Basic Linux. Daniel Balagué
Working with Basic Linux Daniel Balagué How Linux Works? Everything in Linux is either a file or a process. A process is an executing program identified with a PID number. It runs in short or long duration
More informationTJU Syllabus for Linux Fundamentals and Applications
TJU Syllabus for Linux Fundamentals and Applications Code: 2160281 Title: Linux Fundamentals and Applications Semester Hours: 40 Credits: 2 Semester Structure Offered by: for: Prerequisite: Hour Lecture:24
More information2) clear :- It clears the terminal screen. Syntax :- clear
1) cal :- Displays a calendar Syntax:- cal [options] [ month ] [year] cal displays a simple calendar. If arguments are not specified, the current month is displayed. In addition to cal, the ncal command
More informationScripting Languages Course 1. Diana Trandabăț
Scripting Languages Course 1 Diana Trandabăț Master in Computational Linguistics - 1 st year 2017-2018 Today s lecture Introduction to scripting languages What is a script? What is a scripting language
More informationCSE 390a Lecture 5. Intro to shell scripting
CSE 390a Lecture 5 Intro to shell scripting slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/390a/ 1 2 Lecture summary basic script syntax and running
More informationA Brief Introduction to the Linux Shell for Data Science
A Brief Introduction to the Linux Shell for Data Science Aris Anagnostopoulos 1 Introduction Here we will see a brief introduction of the Linux command line or shell as it is called. Linux is a Unix-like
More information*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG
*nix Crash Course Presented by: Virginia Tech Linux / Unix Users Group VTLUUG Ubuntu LiveCD No information on your hard-drive will be modified. Gives you a working Linux system without having to install
More informationContents. xxvii. Preface
Preface xxvii Chapter 1: Welcome to Linux 1 The GNU Linux Connection 2 The History of GNU Linux 2 The Code Is Free 4 Have Fun! 5 The Heritage of Linux: UNIX 5 What Is So Good About Linux? 6 Why Linux Is
More informationEECS2301. Lab 1 Winter 2016
EECS2301 Lab 1 Winter 2016 Lab Objectives In this lab, you will be introduced to the Linux operating system. The basic commands will be presented in this lab. By the end of you alb, you will be asked to
More informationSystem Programming. Unix Shells
Content : Unix shells by Dr. A. Habed School of Computer Science University of Windsor adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Introduction 2 Interactive and non-interactive
More informationCOL100 Lab 2. I semester Week 2, Open the web-browser and visit the page and visit the COL100 course page.
COL100 Lab 2 I semester 2017-18 Week 2, 2017 Objective More familiarisation with Linux and its standard commands Part 1 1. Login to your system and open a terminal window. 2. Open the web-browser and visit
More informationIntroduction of Linux
Introduction of Linux 阳 oslab2018_class1@163.com 寅 oslab2018_class2@163.com PART I Brief Introduction Basic Conceptions & Environment Install & Configure a Virtual Machine Basic Commands PART II Shell
More informationCS Unix Tools & Scripting
Cornell University, Spring 2014 1 February 21, 2014 1 Slides evolved from previous versions by Hussam Abu-Libdeh and David Slater Announcement HW 4 is out. Due Friday, February 28, 2014 at 11:59PM. Wrapping
More informationIntroduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017
Introduction to Linux Part 1 Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017 ssh Login or Interactive Node kingspeak.chpc.utah.edu Batch queue system kp001 kp002. kpxxx FastX
More informationChapter 1 - Introduction. September 8, 2016
Chapter 1 - Introduction September 8, 2016 Introduction Overview of Linux/Unix Shells Commands: built-in, aliases, program invocations, alternation and iteration Finding more information: man, info Help
More informationIntroduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie
Introduction in Unix Linus Torvalds Ken Thompson & Dennis Ritchie My name: John Donners John.Donners@surfsara.nl Consultant at SURFsara And Cedric Nugteren Cedric.Nugteren@surfsara.nl Consultant at SURFsara
More informationIntroduction to UNIX/Linux
Introduction to UNIX/Linux Biochemistry Boot Camp 2018 Session #3 Nick Fitzkee nfitzkee@chemistry.msstate.edu Operating system (OS) Some terms Command-line interface (CLI) Graphical user interface (GUI)
More information