The Command Shell. Fundamentals of Computer Science

Similar documents
Introduction to Linux. Fundamentals of Computer Science

Instructions. First, download the file

Lesson 04: Our First Java Program (W01D4

Getting Started with Command Prompts

CS CS Tutorial 2 2 Winter 2018

User Guide Version 2.0

The Command Shell, Libraries and Clients, Formatted Printing. Fundamentals of Computer Science

About shells and command lines

CS 261 Recitation 1 Compiling C on UNIX

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

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

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

CSCI 161: Introduction to Programming I Lab 1a: Programming Environment: Linux and Eclipse

CSC116: Introduction to Computing - Java

Life Without NetBeans

Datathon 2018 Connecting to MicroStrategy on AWS Cloud

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

Session 1: Accessing MUGrid and Command Line Basics

LAB #5 Intro to Linux and Python on ENGR

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

Lab 1 Introduction to UNIX and C

SmartCVS Tutorial. Starting the putty Client and Setting Your CVS Password

You should see something like this, called the prompt :

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

Linux Bootcamp Fall 2015

Operating System Interaction via bash

You can use the WinSCP program to load or copy (FTP) files from your computer onto the Codd server.

Lab 1 Introduction to UNIX and C

CSC116: Introduction to Computing - Java

CS 246 Winter Tutorial 1

Author A.Kishore/Sachin WinSCP

CMSC 201 Spring 2018 Lab 01 Hello World

CMSC 201 Spring 2017 Lab 01 Hello World

CHE3935. Lecture 1. Introduction to Linux

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

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

Part I. UNIX Workshop Series: Quick-Start

CSC116: Introduction to Computing - Java

Bioinformatics? Reads, assembly, annotation, comparative genomics and a bit of phylogeny.

Introduction to the Linux Command Line

Intermediate Programming, Spring Misha Kazhdan

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

CMPSCI 120 Fall 2017 Lab #1 Professor William T. Verts

Short Read Sequencing Analysis Workshop

CS 143A. Principles of Operating Systems. Instructor : Prof. Anton Burtsev

: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.

New User Tutorial. OSU High Performance Computing Center

Helsinki 19 Jan Practical course in genome bioinformatics DAY 0

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

Lab: Supplying Inputs to Programs

CSCI 2132 Software Development. Lecture 4: Files and Directories

CS Operating Systems, Fall 2018 Project #0 Description

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

Perl and R Scripting for Biologists

COMP 110/401 WINDOWS COMMAND INTERPRETER. Instructor: Prasun Dewan (FB 150,

Lec 1 add-on: Linux Intro

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

Getting Started with Java. Atul Prakash

Unix Tutorial Haverford Astronomy 2014/2015

Working with the Command Line

AMS 200: Working on Linux/Unix Machines

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

WinSCP. Author A.Kishore/Sachin

1 Getting Started with Linux.

Parallel Programming Pre-Assignment. Setting up the Software Environment

Working Outside the Lab

C++ Programming on Linux

Introduction. SSH Secure Shell Client 1

CMPSCI 120 Fall 2013 Lab #2 Professor William T. Verts

Introduction. File System. Note. Achtung!

UNIT 9 Introduction to Linux and Ubuntu

CPSC 150 Laboratory Manual. Lab 1 Introduction to Program Creation

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

Guided Tour (Version 3.3) By Steven Castellucci as Modified by Brandon Haworth

Remote Access to Unix Machines

Gradle and Command Line Workshop Activity

Unit 10. Linux Operating System

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

Introduction to the Linux Command Line January Presentation Topics

Introduction to Linux

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

Setup Procedure for NEESPOP prior to Testing

Find out where you currently are in the path Change directories to be at the root of your home directory (/home/username) cd ~

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Principles of Bioinformatics. BIO540/STA569/CSI660 Fall 2010

Command Line Interface The basics

Review of Fundamentals

ROS-Industrial Basic Developer s Training Class: Linux Basics. Southwest Research Institute Last Updated 2017

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

C02: Overview of Software Development and Java

Linux File System and Basic Commands

sftp - secure file transfer program - how to transfer files to and from nrs-labs

Lab Working with Linux Command Line

Chap2: Operating-System Structures

WA2321 Continuous Integration with Apache Maven Jenkins-CI and Nexus. Classroom Setup Guide. Web Age Solutions Inc. Web Age Solutions Inc.

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

Linux at the Command Line Don Johnson of BU IS&T

IT151: Introduction to Programming (java)

Transcription:

The Command Shell Fundamentals of Computer Science

Outline Starting the Command Shell Locally Remote Host Directory Structure Moving around the directories Displaying File Contents Compiling and Running a Java Program Editing a Text File Copying Files between Computers File Redirection and Piping Command Summary

Interfacing with your Computer GUI (Graphical User Interfaces) Today: predominant interaction method Windows, buttons, mouse Advantages Easier for novices No commands to remember Rich input and output capabilities 3

Interfacing with your Computer Command Line Interface (CLI) Originally the only option Input by typing commands Advantages: Can be faster for experts than a GUI Easier to automate tasks Easier to hook programs together 4

Starting a Command Shell Windows 7 Start type "cmd" All Programs Accessories Command Prompt Mac Spotlight type "terminal" Go Applications Utilities Terminal 5

Starting a Command Window in Linux: putty Use putty.exe cs.mtech.edu then go to the Students tab, select Software Download both putty and winscp Double click on putty Enter katie.mtech.edu for the Host Name (or you can use an IP) Click Open button Enter login name (first initial last name, all lowercase) Enter password: You will need to change this immediately remember what you changed it to.

Directory Structure Folders /Directories organized in a tree structure Root is at the top, branches below Files are stored in folders/directories On Windows, different devices have different letters Primary hard drive is C: Flash drives are usually E: onward Navigating the tree To change to a directory: Windows: cd C:\Documents\Folder 1\Subfolder 1A Linux: cd root/documents/folder 1/Subfolder 1B Up one directory level: cd.. The current directory:. Where am I? Linux: pwd Windows: usually shown in the prompt

Getting Around in the Command Shell Looking at the contents of a folder Windows: dir Linux: ls 8

Displaying the Contents of Text File Windows: type HelloWorld.java Linux: cat HelloWorld.java

Compiling a Java Program Windows or Linux: javac HelloWorld.java If it all compiles correctly, you ll get back a prompt The file HelloWorld.class is generated If things go wrong, you will get a list of compiler errors and associated line numbers Not always where the error is, but will give you some clues just like in Eclipse What if you want to compile multiple files? javac *.java

Running a Java Program Windows or Linux: java HelloWorld Note: you don t need to type the.class extension If it all runs correctly, you ll get the program results and a prompt If things go wrong, you will get a runtime error and the name of the exception that was thrown Again, will give you some clues just like in Eclipse You should run the file that contains the main method that you want the JVM will find the rest of the files it needs

Editing a Java Program Use any text editor In Linux, vim vim HelloWorld.java Opens up an editor so you can change the code (or create a file) Reference for vim commands: http://www.cmrr.umn.edu/~strupp/vim-3.0.refcard.html In Windows, any text editor Notepad, Wordpad, Eclipse, etc. Just be careful some editors try to help you by giving the file a.txt extension when you save it you need a.java extension in order to compile it

Copying a File to Another Computer: winscp Double click on winscp (you should have already downloaded it from the cs.mtech.edu website) Click the Run button Enter katie.mtech.edu for the host name Enter your user name in the User name box Enter your password in the Password box Hit Enter or click the Login button

Copying a File to Another Computer: winscp (continued) You will see two panes in a window The left side is your local computer The right side is the computer you just logged in to Can drag and drop files between the two sides Or you can drag files from and to File Manager on your local computer

Redirection Redirecting program output to a file using > followed by the output filename. 15

Redirection Reading input from file using < followed by the filename. 16

Piping Using the output of one program as the input to another Use the operator

Summary of Helpful Commands Action Windows Mac OS / Unix Move into a folder cd myfolder cd myfolder Move into parent folder cd.. cd.. Move into a folder, absolute folder cd \Users\keith List files in current folder dir ls Compile program in current folder javac Prog.java cd /Users/keith javac Prog.java Run a compiled program java Prog java Prog See what is in a text file type Prog.java more Prog.java Auto-complete filenames <tab key> <tab key> Previous command <up arrow> <up arrow> 18

Summary Starting the Command Shell Locally Remote Host Directory Structure Moving around the directories Displaying File Contents Compiling and Running a Java Program Editing a Text File Copying Files between Computers File Redirection and Piping Command Summary