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

Similar documents
CS CS Tutorial 2 2 Winter 2018

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Lab Working with Linux Command Line

Introduction to Linux Workshop 1

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

COMS 6100 Class Notes 3

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Introduction to the Linux Command Line

Working with Basic Linux. Daniel Balagué

A Brief Introduction to the Linux Shell for Data Science

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

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

Introduction to Linux. Fundamentals of Computer Science

Exercise 1: Basic Tools

Introduction. File System. Note. Achtung!

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

Command Line Interface The basics

CENG393 Computer Networks Labwork 1

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

Introduction: What is Unix?

Basic Survival UNIX.

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Unix Introduction to UNIX

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

Linux Command Line Primer. By: Scott Marshall

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

An Introduction to Cluster Computing Using Newton

Operating System Interaction via bash

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

Introduction to UNIX Command Line

Unix Workshop Aug 2014

CENG 334 Computer Networks. Laboratory I Linux Tutorial

UNIX Quick Reference

Introduction to Unix: Fundamental Commands

Introduction to Linux Environment. Yun-Wen Chen

IMPORTANT: Logging Off LOGGING IN

Getting Started with UNIX

Introduction to the UNIX command line

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

CS370 Operating Systems

LAB #7 Linux Tutorial

Recitation #1 Boot Camp. August 30th, 2016

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

UTA Tech Orientation Spring 2019

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Linux File System and Basic Commands

Practical Session 0 Introduction to Linux

Lab 2: Linux/Unix shell

Computer Systems and Architecture

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

Parallel Programming Pre-Assignment. Setting up the Software Environment

RH033 Red Hat Linux Essentials

Week 2 Lecture 3. Unix

Introduction to Linux

Getting your department account

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

Linux Shell Script. J. K. Mandal

CS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater)

Chapter-3. Introduction to Unix: Fundamental Commands

Introduction. SSH Secure Shell Client 1

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

Tutorial 1: Unix Basics

Command-line interpreters

Unix Tools / Command Line

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

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

Chap2: Operating-System Structures

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

Intro to Linux & Command Line

Introduction to Linux

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

Unix basics exercise MBV-INFX410

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Introduction to Unix - Lab Exercise 0

Table 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

Computer Systems and Architecture

Recitation #1 Unix Boot Camp. August 29th, 2017

Using the Zoo Workstations

Programming Studio #1 ECE 190

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

MTU Computer Structure

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

LAB #5 Intro to Linux and Python on ENGR

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

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

Introduction to UNIX command-line

System Administration

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.

CHE3935. Lecture 1. Introduction to Linux

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

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

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

Unix L555. Dept. of Linguistics, Indiana University Fall Unix. Unix. Directories. Files. Useful Commands. Permissions. tar.

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

Unix Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : December, More documents are freely available at PythonDSP

Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

Introduction to Linux

Transcription:

Basic Terminal Intro to Linux ssh short for s ecure sh ell usage: ssh [host]@[computer].[otheripstuff] for lab computers: ssh [CSID]@[comp].cs.utexas.edu can get a list of active computers from the UTCS web page by searching lab machines works natively for Macs and Linux machines for Windows machines will need to use Putty WinSCP is also a great program for Windows there is also a secure shell extension for Chrome [ctrl] + [alt] + t [up arrow] history clear man echo [ctrl] + c this will open up a new terminal window for you is super convenient on the computers in the lab this is bring up the last command you used in the your terminal if used multiple times will keep going up in your command history can be useful when using long/ repeated commands the down arrow will go back through commands in the other direction this will print out a list of your previous terminal commands can be useful if you are trying to remember a complex command you did previously but can t quite remember this will totally clear your terminal screen can be useful when have just run something really complex and would like a clean slate short for man ual usage: man [something confusing] example: man grep will give you helpful usage information about certain commands/ system calls is especially useful to look at the flags for commands this will basically just print something to your terminal window usage: echo hello world is really useful in bash scripts NOTE : bash scripts are a way to run a collection of terminal commands as a single command this will stop whatever is currently running in your terminal can be especially useful when you accidently run a program with an infinite loop Or any other long running program/ script that you want to stop

[ctrl] + [shift] + c [ctrl] + [shift] + v sudo exit this will let you copy something from you terminal useful if trying to Google what an error means this will let you paste into the terminal useful if just Googled a way to do something cool short for s uper u ser do will allow you to run commands you normally aren t allowed to usage: sudo [command] NOTE: you cannot run sudo on the lab machines will close out of the terminal window without having the hit the little x in the corner Directories and Files ls short for l i s t lists all the files/ directories in the current directory you might also want to try the sl command on the lab machines ls al pwd cd [tab] mkdir will list all the files in the current directory along with their permissions permissions: read can view the stuff write can edit the stuff execute can run (for scripts and such) 3 sets (owner) (group) (anyone) short for p rint w orking d irectory any easy way to know where you are in the file hierarchy if you forget short for c hange d irectory used to navigate between directories in your file structure usage: cd [directory] can use cd.. to go back up the directory structure can also put in a full path instead of just a directory name / at front of directory will be an absolute path from your root directory no / at front of directory will be a relative path. just means current directory so./hello.txt is the same as hello.txt this will autocomplete whatever you are currently doing in the terminal ex: cd Doc + [tab] would autocomplete Doc to Documents without you having to type out the whole thing short for m a k e dir ectory will make a new directory for you

usage: mkdir [directory name] NOTE: can also use relative vs. absolute paths instead of just a directory name cp scp mv rm touch cat chmod short for c o p y a way to make a copy of something in a different directory usage: cp [source/file name] [destination] again can use relative or absolute paths for the source and destination NOTE: This copies to destinate and keeps the original in source as well short for s ecure c o p y a way to copy files between computers usage: scp [source] [destination] from other computer: scp [host]:[source/file name] [destination on your computer] to other computer: scp [source/file name] [host]:[destination on other computer] short for m o v e a way to actually move files/directories around on your computer also an easy way to rename directories usage: mv [source] [destination] as usual you can use either a relative or absolute path for the source and destination short for r e m ove deletes a file usage: rm [file name] helpful things: rm rf [directory name] will delete a directory and everything inside it use with caution, if you don t give a destination for this it will delete EVERYTHING from your current directory down will either create a new file or update the last modified date on a file to the current date usage: touch [file] short for cat enate will print a file s contents to the terminal usage: cat [file] used to change permissions usage: chmod [new settings] [file] new setting options Reference Operator Mode

u user g group o others a all (everybody) add remove = set exactly r read w write x execute grep find diff a way to search through file(s) usage: grep [search for] [file] can search for things using regex helpful flags: n lists the line number next to matches r search recursively * instead of a file name will search the whole directory used to find out where a file lives in your file hierarchy usage: find [path] name [file] if path is not given then will search the current directory and every directory it contains short for diff erence shows the difference between 2 files usage: diff [file 1] [file 2] helpful flags: b ignore white space diffs i ignore case side by side see differences next to each other Redirection Input/ Output will make the output from command on the left the input for the command on the right ex: man hello grep hello will search for the word hello in the man pages for hello (this will actually work on the lab machines) > and >> < will redirect output on left into the file on the right single > will will replace the contents of the file with the given output and double >> will append to the file ex: echo hello > hello.txt ex: cat [file1] [file2] > [file3] will redirect thing on the right to be the input for the thing on the left ex: ProgramTakesInAge < 12 is really good for testing projects that take in user input

Java Specific java version will tell you what version of Java is currently installed on your machine will also tell you if java is not installed on your machine at all javac java used to compile a java program usage: javac [file] must have the.java extension if successful will create a.class file with the same name as the original Java file used to run a compiled Java file usage: java [name of.class file] ex: java Test don t put.class at the end of the file name this would have come from compiling a file called Test.java UTCS Specific lpq short for l ist p rinter q ueue or at least that is how I remember it will give you a list of pending jobs on a given printer usage: lpq P[printer name] no space between the P and the printer s name the Linux printer in the 3rd floor lab is lw301 lprm chkquota du sk ~/* ~/.??* sort n can use to remove all your pending jobs from a printer s queue usage: lprm P[printer name] [CSID] very useful if the printer is backed up/ not working and you need to run to class soon without worrying about wasting paper short for ch eck quota each UTCS student only gets a certain amount of space so it is important to check how much you are using at any given time if you reach 100% you will stop being able to save files/ do certain things NOTE: caching on certain browsers can cause this quota to fill up quickly, to fix just clear your cache folder will basically tell you which files are using the most memory super useful if your disk quota is at 100% and you need to figure out what to delete

Fun Stuff cal will give you a little ASCII calendar of the current month with the current day highlighted can be useful when you are having a tired moment and forget what your life looks like date yes cowsay fortune xeyes will give you the current date and time as a string again useful if you are having a tired moment and just need to know time still works properly will print the same phrase repeatedly in your terminal until you hit [ctrl] + c usage: yes [some words] will take a phrase and print a little ASCII art cow saying that phrase usage: cowsay [some words] can also pipe things into cowsay you could have a cow tell you your grep output there are also many other animals you could do for a list do cowsay l usage for different animal: cowsay f [animal file] [some words] ex: cowsay f dragon and cow hello will print a random fortune to your screen there are some fun flags for this like, you should man fortune to see what they are these are particularly fun to pipe into cowsay will pop up a screen with little eyes on your screen that will follow your cursor around can be entertaining when you are super stressed/ tired NOTE: won t work over ssh