CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

Similar documents
Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

Introduction to Linux Spring 2014, Section 02, Lecture 3 Jason Tang

Basic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang

CSCI 2132 Software Development. Lecture 4: Files and Directories

Lab 1 Introduction to UNIX and C

CMSC 201 Spring 2017 Lab 01 Hello World

CS Fundamentals of Programming II Fall Very Basic UNIX

CMSC 201 Spring 2018 Lab 01 Hello World

Introduction to the Linux Command Line

CSC111 Computer Science II

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

Lab 1 Introduction to UNIX and C

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

User Guide Version 2.0

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Introduction to Linux. Fundamentals of Computer Science

Beyond this course. Machine code. Readings: CP:AMA 2.1, 15.4

Parallel Programming Pre-Assignment. Setting up the Software Environment

Physics REU Unix Tutorial

Introduction to Linux

1 Getting Started with Linux.

Mills HPC Tutorial Series. Linux Basics I

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

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

Introduction to Linux

CS CS Tutorial 2 2 Winter 2018

Introduction to Linux

Session 1: Accessing MUGrid and Command Line Basics

Unit 10. Linux Operating System

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Practical Session 0 Introduction to Linux

Linux Tutorial. Ken-ichi Nomura. 3 rd Magics Materials Software Workshop. Gaithersburg Marriott Washingtonian Center November 11-13, 2018

Using the Zoo Workstations

Unix Tutorial Haverford Astronomy 2014/2015

CS 261 Recitation 1 Compiling C on UNIX

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

1. The Mac Environment in Sierra Hall 1242

Introduction: What is Unix?

You should see something like this, called the prompt :

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Intro to HPC Exercise

1. The Mac Environment in SIE 1222

Linux File System and Basic Commands

Introduction to Linux

The Directory Structure

Getting Started with UNIX

Embedded Systems Ch 3A Linux Development Environment

Unix Basics. Systems Programming Concepts

Introduction to Cygwin Operating Environment

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.

C++ Programming on Linux

Introduction to Linux Basics

CISC 220 fall 2011, set 1: Linux basics

Linux hep.wisc.edu

Hand-on Labs for Chapter 1 and Appendix A CSCE 212 Introduction to Computer Architecture, Spring

Linux Survival Guide

Unix background. COMP9021, Session 2, Using the Terminal application, open an x-term window. You type your commands in an x-term window.

Intermediate Programming, Spring Misha Kazhdan

Introduction to Unix and Linux. Workshop 1: Directories and Files

For Dr Landau s PHYS8602 course

EKT332 COMPUTER NETWORK

Refresher workshop in programming for polytechnic graduates General Java Program Compilation Guide

Unit 13. Linux Operating System Debugging Programs

AMS 200: Working on Linux/Unix Machines

STA 303 / 1002 Using SAS on CQUEST

CSC 112 Lab 1: Introduction to Unix and C++ Fall 2009

CHEM5302 Fall 2015: Introduction to Maestro and the command line

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line

Scripting Languages Course 1. Diana Trandabăț

Getting started with UNIX/Linux for G51PRG and G51CSA

Development Environment & Linux Guide

COSC UNIX. Textbook. Grading Scheme

UNLV Computer Science Department CS 135 Lab Manual

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Introduction of Linux

The Command Shell. Fundamentals of Computer Science

Introduction to the basics of UNIX

Unix Workshop Aug 2014

Short Read Sequencing Analysis Workshop

Linux Command Line Primer. By: Scott Marshall

Parts of this tutorial has been adapted from M. Stonebank s UNIX Tutorial for Beginners (

Linux/Cygwin Practice Computer Architecture

Linux Bootcamp Fall 2015

Operating System Interaction via bash

Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory

Lab Working with Linux Command Line

Working With Unix. Scott A. Handley* September 15, *Adapted from UNIX introduction material created by Dr. Julian Catchen

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

5/8/2012. Creating and Changing Directories Chapter 7

The Command Line. Matthew Bender. September 10, CMSC Command Line Workshop. Matthew Bender (2015) The Command Line September 10, / 25

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

Helsinki 19 Jan Practical course in genome bioinformatics DAY 0

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

An Introduction to Unix

Lecture 1. A. Sahu and S. V. Rao. Indian Institute of Technology Guwahati

CSC116: Introduction to Computing - Java

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

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

Transcription:

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

A layer of software that runs between the hardware and the user. Controls how the CPU, memory and I/O devices work together to execute programs Keeps track of all programs currently running Allows the user to tell it what to do Controls access (login) to the computer Takes commands from a user and executes them Often referred to as simply OS

A particular OS may run on several different hardware platforms Linux on PCs, Smartphones, PDAs, servers Windows on PCs, Smartphones, PDAs, servers Customized for each platform One hardware platform may run multiple OS Macs can run MacOSorWindows PCs can run both Linux and Windows

You communicate using the particular OS s user interface. Graphical User Interface(GUI) Point and Click Command-driven interface Type in text Response is text

When you boot the GL lab computer into Linux, you can choose GUI Command-driven Interface Both GUI Example of Interfaces Command Line

Linux command line interface Edit Compile Execute Submit

A file is a sequence of bytes. It can be created by a text editor (Nano, VI or Notepad) a computer program (such as a C program) It may contain a program, data, a document, or other information. Files that contain other files are called directories (sometimes called folders).

For this class, you should stick with filenames that contain only letters (upper or lower case) digits underscore ( _ ) or hypen(-) No spaces! Up to 255 characters Filenames are case sensitive Some examples: firefox.exe, things2do.txt, dinner_menu.pdf

Directories contain files other directories called subdirectories. may be empty. Directories are organized in a hierarchical fashion in a tree-like structure They help us to keep our files organized.

How can you tell which are files and which are directories?

Your home directoryis where you are located when you log in (e.g., /afs/umbc.edu/users/j/d/jdoe28/home/). The current directoryis where you are located at any time while you are using the system. The /(pronounced slash ) is the root directory in Linux. Files within the same directory must be given unique names. Each running program has a current directory and all filenames are implicitly assumed to start with the name of that directory unless they begin with a slash.

Paths allow us to give the same name to different files located in different directories. Absolute Path The absolute path is a path that contains the root directory and all other subdirectories you need to access the file It points to the same location in the directory tree regardless of the current working directory Relative Path The relative path is a partial path to a file in relation to the current working directory If inside of the home directory in the previous directory example, a relative path would be

Relative

Are used for organizing your files

Command Description cd directory make directory the current working directory ls lists the contents of the current working directory cp sourcefile destinationfile copy the contents of sourcefile into a new file named destinationfile rm filename delete the file named filename mv sourcefile destinationfile rename the file named sourcefile to destinationfile cd.. move down a directory man command shows a manual on how to use the command word (hit q to quit) mkdir directory creates the directory named of your choosing rmdir directory deletes the PRE-EXISTING directory named lpr filename prints file

In your home directory, Make a subdirectory for CMSC104 In the CMSC104 directory Make subdirectories for each homework (12) Make subdirectories for each project (2 projects)

. (dot) is the current directory... (dot-dot) is the parent directory. Use the Linux command cd to change directories. Use dot-dot to move one directory up in the tree Use the subdirectory name to move down. Use the complete (absolute) directory name (path name) to move anywhere. Practice Change your current directory to hw1/ Change your current directory to project1/

You will find wildcard characters useful when manipulating files listing or moving them The wildcard characters are * and?? is used to represent any single character. * is used to represent 0 or more characters.

? any single character. * 0or more characters Given the files in the directory below, what will be the output from the following commands? ls hw*.txt ls hw?.txt hw1.txt hw123.txt cmsc104.txt hw2.txt hw_assignment.txt cmsc201.ppt hw.txt lupoli.txt

AFS is network file system. AFS is a way of keeping track of your files over the network. Features All of the lab computers: Windows, Linux, IRIX, and Mac, are capable of reading this file system. The files that you maintain in your account will be accessible to you over the network from any of these computers. No need to store your information on a flash drive and carry it between machines.

Every GL account is assigned a directory on AFS, which contains the home directory. On all of the UNIX systems here at UMBC it will be located at the following location: /afs/umbc.edu/users/u/s/username/ uis the first letter of your username, sis the second letter of your username, and usernameis your GL account logon name.

Command line editors in Linux vi emacs nano easiest and resembles notepad Can be used with PuTTY

To create the file and start the editor nano hello.c Type #include <stdio.h> main() { printf("hello World! \n"); } To save the file Press Cntl-X Press Y Press Enter

Compile your program gcc-o hello hello.c Run your program./hello Output should be: Hello World!

You can connect to the GL machines from your personal machine using PuTTY When you connect to GL through Putty, you are using only the command-driven Interface. How to install and run PuTTYon Windows http://userpages.umbc.edu/~dhood2/courses/misc/spring08/ working-from-home/putty.html PuTTY download page http://www.chiark.greenend.org.uk/~sgtatham/putty/downlo ad.html