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

Size: px
Start display at page:

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

Transcription

1 Contents Note: pay attention to where you are Note: Plaintext version Hello World of the Bash shell 2 Accessing a remote shell Hello world Shell tricks Tab autocompletion History Navigating the filesystem 3 Basics Relative and absolute paths Shortcuts Working with files and directories 5 Moving files around the local filesystem Moving files over the Internet Useful flags Using scp Online sharing from the command line Manipulating output of a command 6 See more or less I/O redirection and pipes Writing shell scripts 8 Creating a shell script Running a shell script Leave a script running for later More resources 10 Note: pay attention to where you are When using remote systems (such as GENI VMs), a common point of confusion is misunderstanding where things are or happen. For example: where a particular file is, what system a command is run on, and what network link a packet will travel over. Throughout this tutorial, try and pay attention to where things are. What host (computer) am I on (your laptop? or a VM on GENI?)? What filesystem and directory am I in? What network am I on (the public Internet? or a private link on GENI?)? Note: Plaintext version A plaintext (Markdown) version of this handout is available at 1

2 Hello World of the Bash shell Accessing a remote shell Reserve a single VM using the GENI Portal. Then, gain access to this VM by opening a terminal on your laptop and using SSH to log in to it. First, open a terminal: On OS X, open Applications Utilities Terminal. If you are using Windows, you should have previously installed Git Bash. To open it, click the Windows or Start icon. In the Programs list, click on Git Git Bash. If you are running Ubuntu Linux, you can open the Dash (Super Key) or Applications and type terminal. Or, use the keyboard shortcut by pressing Ctrl + Alt + T. For other Linux flavors, you may have to modify these instructions slightly. This is your local shell. Make a note of what the prompt looks like. For example, mine looks like this: ffund@ffund-laptop:~$ It shows my username (ffund), hostname (ffund-laptop), my current working directory (~), and then a $ to signify that I m working as a normal (unprivileged) user. (If I was working as the privileged root user, the prompt would end with a # instead.) Next get your login information for your newly reserved VM from the GENI Portal, and use SSH to log in to the remote shell. Now, if you look at your prompt, you should notice that the username and hostname are different from your local shell. When working on remote servers, the prompt is useful for determining where you are running a command - on what host, and from what directory or filesystem. Unless otherwise specified, the commands in the rest of this tutorial should be run on the remote shell. Hello world For the standard hello world exercise, we use the echo command to print a quoted string to the terminal output. At the terminal prompt, type: echo "Hello world" and then hit Enter to run the command you ve just entered. Shell tricks Tab autocompletion Many terminals have a feature called tab autocompletion where, when you type a partial command and then press the Tab key, it will finish the command for you. Let s try this with the whoami command. First write out the entire command: whoami When you hit Enter, you should see that this command returns your username. Now try typing just whoa and then hit Tab. At the prompt, the rest of the command whoami should be filled out, and you can then hit Enter to run it. 2

3 Tab will only fill out the entire command if only one command on the system matches what you ve entered so far. If there are multiple matching commands, Tab will show you all of them. You ll have to continue typing in the one you want until there is only one match, and then Tab will autocomplete it for you. Try typing who and then hit Tab to see how this works. Tab autocompletion also works for file and directory names, for arguments to many commands, and for variables. For example, suppose you save the string hello world in a new variable called mymessage like this: mymessage="hello world" (note that there is no space on either side of the =). You can then run echo $mym and hit Tab, and it will be autocompleted to echo $mymessage (which will print hello world to the terminal output). History It s often useful to be able to see and re-run commands you ve previously run. You can use the and keys to scroll through your previous commands. Or, to see your command history all at once, run history You ll note that each line in the output of the history command has a number next to it, with which you can re-run that command. To run a command that appears as number 1 in your history, run!1 or, to quickly run your last command again (without having to specify the number), you can run!! Navigating the filesystem Basics First, check where you are currently located in the filesystem with the pwd ( print working directory ) command: pwd Next, list the contents of the directory you are in: ls To create a new directory inside our current directory, run mkdir and specify a name for the new directory, like mkdir new You can change directory by running cd and specifying the directory you want to change to. For example, to change to the directory you ve just created, run 3

4 cd new and then use pwd again to verify your current working directory. Relative and absolute paths You may have noticed that when you run the pwd command, it gives you a full path with several directory names separated by a / character. This is a full path. For example, after running the commands above, I would see the following output for pwd: /users/ff524/new When you run commands that involve a file or directory, you can always give a full path, which starts with a / and contains the entire directory tree up until the file or directory you are interested in. For example, I can run cd /users/ff524 to return to my home directory. Alternatively, you can give a path that is relative to the directory you are in. For example, when I am inside my home directory (/users/ff524 - yours will be different), which has a directory called new inside it, I can navigate into the new directory with a relative path: cd new or the absolute path: cd /users/ff524/new Shortcuts Running cd with no argument takes you to your home directory. The shorthand.. refers to the directory that is one level higher (can be used with cd and with other commands). The shorthand ~ refers to the current user s home directory (can be used with cd and with other commands). After navigating to a new directory with cd, you can then use cd - to return to the directory you were in previously. Try these commands. Before and after each cd command, run pwd to see where you have started and where you ended up after running the command. cd # takes you to your home directory cd.. # takes you one directory "higher" from where you were before cd ~ # takes you to your home directory cd../.. # takes you two directories "higher" from where you were before cd - # takes you to the directory you were in before the last time you ran "cd" 4

5 Working with files and directories Moving files around the local filesystem The easiest way to create a file is to just open it for editing. We will use the nano text editor to open file called newfile.txt: nano newfile.txt You can type some text into this file, then use Ctrl + O to write it out to file, and hit Enter to confirm the file name to which to save. Near the bottom of the screen, it should say e.g. [ Wrote 1 line ]. Then use Ctrl + X to exit. To see the contents of a file, we can print the contents of the file to the terminal output with cat: cat newfile.txt To copy a file, we use cp, and give the source and destination file names as arguments: cp newfile.txt copy.txt To move (or rename) a file, we use the mv command: mv copy.txt mycopy.txt and we use rm to delete a file: rm mycopy.txt With rm, there is no Recycle Bin and no getting back files you ve deleted accidentally - so be very, very careful. Moving files over the Internet We will often have to move files over the Internet - for example, get a file from the Internet onto our local filesystem, or copy a file from a remote system that we access with SSH to our local filesystem. Use wget to download from the Internet. For example, to download a file I ve put at we can run wget Use cat README.txt to verify that you ve retrieved the file and see its contents. Similarly, you can download anything from the web by URL. Useful flags Bash utilities typically have some flags you can use to modify the way they behave, or what their output looks like. For example, take the ls command. We can: See one file per output line: ls -1 See long output that includes file permissions, ownership, modification dates: ls -l See long output and also sort files in order of time of last modification: ls -lt See long output and sort files so that the most recently modified file is last: ls -ltr 5

6 With most utilities, you can use the --help flag to find out how to use the utility and what flags are available for it: ls --help Using scp To move files back and forth between your laptop and a remote system that you access with ssh, we can use scp. The syntax is: scp source destination When using scp, you have to pay attention to where you are running a command. Assuming you have a file README.txt located in your home directory on your VM, you can run scp -P PORT USERNAME@HOSTNAME:~/README.txt. (substituting your own PORT, USERNAME, and HOSTNAME using the details provided by the GENI Portal.) from a shell on your laptop (in the local shell) to retrieve that file from the server and copy it to whatever directory you are working in on your laptop. (The. shortcut indicates put the file here.) Note that the part immediately following the : is the full path to the file you want to transfer. You ll have to make sure you have the necessary file permissions to write files to the directory you are working in! If you get a message indicating a file permission error, you may have to specify a path to a directory in which you have write permission, instead of the. argument. Once you have transferred the file, you can make changes to the file locally and copy it back to your home directory on the server, with scp -P PORT README.txt USERNAME@HOSTNAME:~/README2.txt Online sharing from the command line Sometimes we ll want to do the reverse of wget - upload a file to the Internet, using the Linux shell. There are several online services that provide an API for this. To use them, you ll need to first install curl: sudo apt-get update sudo apt-get -y install curl For example, to upload the bikes README.txt you downloaded earlier, you can run curl --upload-file./readme.txt This will return a URL, which you can open in a browser to see and download the file you ve just uploaded. Manipulating output of a command See more or less We ll often want to see more or less of a command that has a lot of output. To see how this works, let s download a large text file - a book from Project Gutenberg. Download it with 6

7 wget If you run cat book.txt to see the contents of the file, you won t see much - there s just too much output, and it goes by too quickly. To see the beginning of the book, use head book.txt To see just the end, use tail book.txt You can also specify the number of lines to see with either command, with e.g. head --lines=5 book.txt tail --lines=10 book.txt To page through one line of output at a time, use less book.txt You can use Enter to continue scrolling through the file, or q to quit at any time. It s often useful to count the number of lines of output in a file. We can use wc: wc -l book.txt Finally, it s nice to be able to see only lines matching a particular pattern. There s a very powerful utility called grep that allows us to filter the output to see only those lines that contain a particular word. For example, to see lines containing the word information, you can run grep "information" book.txt I/O redirection and pipes The real value of the shell comes in our ability to chain together multiple utilities. For example, suppose we want to count the number of lines in our book that contain the work information. We can save those lines to a file using the > operator to redirect the output of the grep command: grep "information" book.txt > infolines.txt Use cat infolines.txt to verify the contents of the new file we ve just created. Now, we can run wc -l infolines.txt to see the number of lines. Alternatively, we can skip writing to a file and just send the output of the grep command directly to the wc command that follows it with the pipe operator, : 7

8 grep "information" book.txt wc -l We may occasionally want to send the output of a command to a file, but append to an existing file rather than create a new one (as > does). To append to an existing file we will use >>. For example, to create a file that contains all lines with the word when, followed by all lines with the word where, you can run grep "when" book.txt" > morelines.txt grep "where" book.txt >> morelines.txt The second line won t overwrite the text that is written to morelines.txt in the first line; it will append to the file instead. Finally, another useful tool is tee, which we can use to send output to both the terminal and to a file. For example, try grep "when" book.txt tee morelines.txt Writing shell scripts Creating a shell script What makes the shell really powerful is your ability to take a complicated workflow, save it in a file, and then re-run those operations later just by running one command. A shell script is just a file that contains commands, just as we would run them at the terminal. For example, to run the Hello world of shell scripts, create a new file called hello.sh that contains the following: echo "Hello world" Running a shell script To run the shell script hello.sh that we have just created, we would run bash hello.sh We may prefer to run our scripts as hello.sh directly, without having to specify each time that they should be run using the Bash terminal. To do this, we ll add a line called a shebang at the top of our script that tells the operating system what program to use to run the script. To write a shebang, we put the character sequence #! followed by the path to the interpreter at the top of our script. Modify your hello.sh script to look like this: #!/bin/bash echo "Hello world" There s one more step we need to take: we need to mark the script as an executable file with chmod. First, verify that the script is not marked as executable: ls -l 8

9 Note the -rw-r--r-- next to hello.sh: this indicates that the file may be read and written by the user that owns it, read by members of the group that owns it, and read by all users of the system. (The user and group that own the file are also listed in the ls -l output.) To make it executable, we will run chmod a+x hello.sh to give the exexcutable permission to all users of the system. Now, the ls -l output should show -rwxr-xr-x. At this point we can run the script by either running./hello.sh while in the same directory, or by supplying the full path to hello.sh from anywhere else in the system. Leave a script running for later When working on a remote system, it s useful to be able to run a script and come back to it later. Try saving the following script: #!/bin/bash for i in $(seq 100); do echo "On iteration $i" sleep 30 done This script will run for a long time. Suppose you want to start it and come back to it later? screen is a useful tool for this. Install screen with sudo apt-get update sudo apt-get -y install screen Then, start a new screen session with screen -S "mysession" (passing any name you like to the session). Start your very long script running. Then, detach from your current screen session with Ctrl + A + D. Your script is still running; but you can go on and do other things, or log off and log back on. To resume your session, run screen -ls to list all your sessions. Then run screen -R mysession to re-attach to your running session, by name. 9

10 More resources If you are interested in more exercises related to using the Unix shell, see Software Carpentry: 10

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CENG 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 information

A Brief Introduction to the Linux Shell for Data Science

A 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

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

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

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: Linux Tutorial How to read the examples When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: $ application file.txt

More information

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

Unix/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 information

Introduction: What is Unix?

Introduction: 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 information

Recap From Last Time:

Recap From Last Time: Recap From Last Time: BGGN 213 Working with UNIX Barry Grant http://thegrantlab.org/bggn213 Motivation: Why we use UNIX for bioinformatics. Modularity, Programmability, Infrastructure, Reliability and

More information

BGGN 213 Working with UNIX Barry Grant

BGGN 213 Working with UNIX Barry Grant BGGN 213 Working with UNIX Barry Grant http://thegrantlab.org/bggn213 Recap From Last Time: Motivation: Why we use UNIX for bioinformatics. Modularity, Programmability, Infrastructure, Reliability and

More information

Exploring UNIX: Session 3

Exploring UNIX: Session 3 Exploring UNIX: Session 3 UNIX file system permissions UNIX is a multi user operating system. This means several users can be logged in simultaneously. For obvious reasons UNIX makes sure users cannot

More information

Chapter 4. Unix Tutorial. Unix Shell

Chapter 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 information

CS CS Tutorial 2 2 Winter 2018

CS CS Tutorial 2 2 Winter 2018 CS CS 230 - Tutorial 2 2 Winter 2018 Sections 1. Unix Basics and connecting to CS environment 2. MIPS Introduction & CS230 Interface 3. Connecting Remotely If you haven t set up a CS environment password,

More information

Week 2 Lecture 3. Unix

Week 2 Lecture 3. Unix Lecture 3 Unix Terminal and Shell 2 Terminal Prompt Command Argument Result 3 Shell Intro A system program that allows a user to execute: shell functions (e.g., ls -la) other programs (e.g., eclipse) shell

More information

1 Installation (briefly)

1 Installation (briefly) Jumpstart Linux Bo Waggoner Updated: 2014-09-15 Abstract A basic, rapid tutorial on Linux and its command line for the absolute beginner. Prerequisites: a computer on which to install, a DVD and/or USB

More information

Recap From Last Time: Setup Checklist BGGN 213. Todays Menu. Introduction to UNIX.

Recap From Last Time: Setup Checklist   BGGN 213. Todays Menu. Introduction to UNIX. Recap From Last Time: BGGN 213 Introduction to UNIX Barry Grant http://thegrantlab.org/bggn213 Substitution matrices: Where our alignment match and mis-match scores typically come from Comparing methods:

More information

Unix Tutorial Haverford Astronomy 2014/2015

Unix Tutorial Haverford Astronomy 2014/2015 Unix Tutorial Haverford Astronomy 2014/2015 Overview of Haverford astronomy computing resources This tutorial is intended for use on computers running the Linux operating system, including those in the

More information

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program Using UNIX. UNIX is mainly a command line interface. This means that you write the commands you want executed. In the beginning that will seem inferior to windows point-and-click, but in the long run the

More information

The Unix Shell & Shell Scripts

The 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 information

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

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Objective: Learn some basic aspects of the UNIX operating system and how to use it. What is UNIX? UNIX is the operating system used by most computers

More information

Open up a terminal, make sure you are in your home directory, and run the command.

Open up a terminal, make sure you are in your home directory, and run the command. More Linux Commands 0.1 wc The Linux command for acquiring size statistics on a file is wc. This command can provide information from line count, to bytes in a file. Open up a terminal, make sure you are

More information

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words More Linux Commands 1 wc The Linux command for acquiring size statistics on a file is wc. This command provides the line count, word count and number of bytes in a file. Open up a terminal, make sure you

More information

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

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2 Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades 2017-2018 Q2 Facultat d Informàtica de Barcelona This first lab session is focused on getting experience in working

More information

Unix/Linux Primer. Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois

Unix/Linux Primer. Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois Unix/Linux Primer Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois August 25, 2017 This primer is designed to introduce basic UNIX/Linux concepts and commands. No

More information

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

GNU/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 information

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

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab 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

More information

Introduction To. Barry Grant

Introduction To. Barry Grant Introduction To Barry Grant bjgrant@umich.edu http://thegrantlab.org Working with Unix How do we actually use Unix? Inspecting text files less - visualize a text file: use arrow keys page down/page up

More information

CENG393 Computer Networks Labwork 1

CENG393 Computer Networks Labwork 1 CENG393 Computer Networks Labwork 1 Linux is the common name given to a large family of operating systems. All Linux-based operating systems are essentially a large set of computer software that are bound

More information

Working with Basic Linux. Daniel Balagué

Working 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 information

Introduction to UNIX Command Line

Introduction to UNIX Command Line Introduction to UNIX Command Line Files and directories Some useful commands (echo, cat, grep, find, diff, tar) Redirection Pipes Variables Background processes Remote connections (e.g. ssh, curl) Scripts

More information

Introduction 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 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 information

DAVE LIDDAMENT INTRODUCTION TO BASH

DAVE LIDDAMENT INTRODUCTION TO BASH DAVE LIDDAMENT INTRODUCTION TO BASH @daveliddament FORMAT Short lectures Practical exercises (help each other) Write scripts LEARNING OBJECTIVES What is Bash When should you use Bash Basic concepts of

More information

Introduction to Linux

Introduction to Linux Introduction to Linux The command-line interface A command-line interface (CLI) is a type of interface, that is, a way to interact with a computer. Window systems, punched cards or a bunch of dials, buttons

More information

Linux Command Line Primer. By: Scott Marshall

Linux 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 information

Perl and R Scripting for Biologists

Perl 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 information

Introduction to Linux

Introduction 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 information

Introduction to Linux for BlueBEAR. January

Introduction to Linux for BlueBEAR. January Introduction to Linux for BlueBEAR January 2019 http://intranet.birmingham.ac.uk/bear Overview Understanding of the BlueBEAR workflow Logging in to BlueBEAR Introduction to basic Linux commands Basic file

More information

Introduction to the Linux Command Line

Introduction to the Linux Command Line Introduction to the Linux Command Line May, 2015 How to Connect (securely) ssh sftp scp Basic Unix or Linux Commands Files & directories Environment variables Not necessarily in this order.? Getting Connected

More information

CS 460 Linux Tutorial

CS 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 information

Introduction 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 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 information

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Scripting Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Adapted from Practical Unix and Programming Hunter College Copyright 2006 2009 Stewart Weiss What a shell

More information

LING 408/508: Computational Techniques for Linguists. Lecture 5

LING 408/508: Computational Techniques for Linguists. Lecture 5 LING 408/508: Computational Techniques for Linguists Lecture 5 Last Time Installing Ubuntu 18.04 LTS on top of VirtualBox Your Homework 2: did everyone succeed? Ubuntu VirtualBox Host OS: MacOS or Windows

More information

The Shell. EOAS Software Carpentry Workshop. September 20th, 2016

The Shell. EOAS Software Carpentry Workshop. September 20th, 2016 The Shell EOAS Software Carpentry Workshop September 20th, 2016 Getting Started You need to download some files to follow this lesson. These files are found on the shell lesson website (see etherpad) 1.

More information

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

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan DATA 301 Introduction to Data Analytics Command Line Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Why learn the Command Line? The command line is the text interface

More information

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

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line DATA 301 Introduction to Data Analytics Command Line Why learn the Command Line? The command line is the text interface to the computer. DATA 301: Data Analytics (2) Understanding the command line allows

More information

Session 1: Accessing MUGrid and Command Line Basics

Session 1: Accessing MUGrid and Command Line Basics Session 1: Accessing MUGrid and Command Line Basics Craig A. Struble, Ph.D. July 14, 2010 1 Introduction The Marquette University Grid (MUGrid) is a collection of dedicated and opportunistic resources

More information

Useful Unix Commands Cheat Sheet

Useful Unix Commands Cheat Sheet Useful Unix Commands Cheat Sheet The Chinese University of Hong Kong SIGSC Training (Fall 2016) FILE AND DIRECTORY pwd Return path to current directory. ls List directories and files here. ls dir List

More information

Computer Systems and Architecture

Computer 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 information

Command Line Interface The basics

Command Line Interface The basics Command Line Interface The basics Marco Berghoff, SCC, KIT Steinbuch Centre for Computing (SCC) Funding: www.bwhpc-c5.de Motivation In the Beginning was the Command Line by Neal Stephenson In contrast

More information

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors CSE 391 Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson http://www.cs.washington.edu/391/

More information

Essential Linux Shell Commands

Essential Linux Shell Commands Essential Linux Shell Commands Special Characters Quoting and Escaping Change Directory Show Current Directory List Directory Contents Working with Files Working with Directories Special Characters There

More information

Introduction to Linux. Roman Cheplyaka

Introduction 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 information

CS Fundamentals of Programming II Fall Very Basic UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX CS 215 - Fundamentals of Programming II Fall 2012 - Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the CS (Project) Lab (KC-265)

More information

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

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University Introduction to Linux Woo-Yeong Jeong (wooyeong@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating system of a computer What is an

More information

EECS2301. Lab 1 Winter 2016

EECS2301. 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 information

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers A Big Step Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Copyright 2006 2009 Stewart Weiss What a shell really does Here is the scoop on shells. A shell is a program

More information

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

Introduction to Unix and Linux. Workshop 1: Directories and Files Introduction to Unix and Linux Workshop 1: Directories and Files Genomics Core Lab TEXAS A&M UNIVERSITY CORPUS CHRISTI Anvesh Paidipala, Evan Krell, Kelly Pennoyer, Chris Bird Genomics Core Lab Informatics

More information

Introduction. File System. Note. Achtung!

Introduction. File System. Note. Achtung! 3 Unix Shell 1: Introduction Lab Objective: Explore the basics of the Unix Shell. Understand how to navigate and manipulate file directories. Introduce the Vim text editor for easy writing and editing

More information

Introduction to Unix: Fundamental Commands

Introduction 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 information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-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 information

Mills HPC Tutorial Series. Linux Basics I

Mills HPC Tutorial Series. Linux Basics I Mills HPC Tutorial Series Linux Basics I Objectives Command Line Window Anatomy Command Structure Command Examples Help Files and Directories Permissions Wildcards and Home (~) Redirection and Pipe Create

More information

COMS 6100 Class Notes 3

COMS 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 information

Linux Bootcamp Fall 2015

Linux Bootcamp Fall 2015 Linux Bootcamp Fall 2015 UWB CSS Based on: http://swcarpentry.github.io/shell-novice "Software Carpentry" and the Software Carpentry logo are registered trademarks of NumFOCUS. What this bootcamp is: A

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Dong-Yun Lee (dylee@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating

More information

Unix Introduction to UNIX

Unix 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 information

Introduction to UNIX command-line

Introduction to UNIX command-line Introduction to UNIX command-line Boyce Thompson Institute March 17, 2015 Lukas Mueller & Noe Fernandez Class Content Terminal file system navigation Wildcards, shortcuts and special characters File permissions

More information

Files

Files http://www.cs.fsu.edu/~langley/cop3353-2013-1/reveal.js-2013-02-11/02.html?print-pdf 02/11/2013 10:55 AM Files A normal "flat" file is a collection of information. It's usually stored somewhere reasonably

More information

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017 Linux Kung Fu Ross Ventresca UBNetDef, Fall 2017 GOTO: https://apps.ubnetdef.org/ What is Linux? Linux generally refers to a group of Unix-like free and open source operating system distributions built

More information

Lab Working with Linux Command Line

Lab Working with Linux Command Line Introduction In this lab, you will use the Linux command line to manage files and folders and perform some basic administrative tasks. Recommended Equipment A computer with a Linux OS, either installed

More information

Lab 2: Linux/Unix shell

Lab 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 information

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

Overview 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 information

Filesystem and common commands

Filesystem and common commands Filesystem and common commands Unix computing basics Campus-Booster ID : **XXXXX www.supinfo.com Copyright SUPINFO. All rights reserved Filesystem and common commands Your trainer Presenter s Name Title:

More information

Unix basics exercise MBV-INFX410

Unix basics exercise MBV-INFX410 Unix basics exercise MBV-INFX410 In order to start this exercise, you need to be logged in on a UNIX computer with a terminal window open on your computer. It is best if you are logged in on freebee.abel.uio.no.

More information

ITST Searching, Extracting & Archiving Data

ITST Searching, Extracting & Archiving Data ITST 1136 - Searching, Extracting & Archiving Data Name: Step 1 Sign into a Pi UN = pi PW = raspberry Step 2 - Grep - One of the most useful and versatile commands in a Linux terminal environment is the

More information

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the EECS labs that dual boot

More information

Introduction to the UNIX command line

Introduction 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 information

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209 CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System

More information

Introduction to the shell Part II

Introduction to the shell Part II Introduction to the shell Part II Graham Markall http://www.doc.ic.ac.uk/~grm08 grm08@doc.ic.ac.uk Civil Engineering Tech Talks 16 th November, 1pm Last week Covered applications and Windows compatibility

More information

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

Introduction 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 information

PROGRAMMAZIONE I A.A. 2015/2016

PROGRAMMAZIONE I A.A. 2015/2016 PROGRAMMAZIONE I A.A. 2015/2016 SHELL SHELL SHELL A program that interprets commands Allows a user to execute commands by typing them manually at a terminal, or automatically in programs called shell scripts.

More information

Computer Systems and Architecture

Computer 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 information

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

Linux 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 information

In this exercise you will practice working with HDFS, the Hadoop. You will use the HDFS command line tool and the Hue File Browser

In this exercise you will practice working with HDFS, the Hadoop. You will use the HDFS command line tool and the Hue File Browser Access HDFS with Command Line and Hue Data Files (local): ~/labs/data/kb/* ~/labs/data/base_stations.tsv In this exercise you will practice working with HDFS, the Hadoop Distributed File System. You will

More information

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors CSE 390a Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson http://www.cs.washington.edu/390a/

More information

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi Lezione 8 Bioinformatica Mauro Ceccanti e Alberto Paoluzzi Dip. Informatica e Automazione Università Roma Tre Dip. Medicina Clinica Università La Sapienza Sommario Shell command language Introduction A

More information

Practical 02. Bash & shell scripting

Practical 02. Bash & shell scripting Practical 02 Bash & shell scripting 1 imac lab login: maclab password: 10khem 1.use the Finder to visually browse the file system (single click opens) 2.find the /Applications folder 3.open the Utilities

More information

CSE 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 , 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 information

Network Monitoring & Management. A few Linux basics

Network Monitoring & Management. A few Linux basics Network Monitoring & Management A few Linux basics Our chosen platform Ubuntu Linux 14.04.3 LTS 64-bit LTS = Long Term Support no GUI, we administer using ssh Ubuntu is Debian underneath There are other

More information

Linux Command Line Interface. December 27, 2017

Linux 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 information

Getting Started With Cpsc (Advanced) Hosted by Jarrett Spiker

Getting Started With Cpsc (Advanced) Hosted by Jarrett Spiker Getting Started With Cpsc (Advanced) Hosted by Jarrett Spiker Advanced? - Assuming that everyone has done at least a year of CPSC already, or has a strong base knowledge. - If not, there is a Beginners

More information

The Linux Command Line & Shell Scripting

The Linux Command Line & Shell Scripting The Linux Command Line & Shell Scripting [web] [email] portal.biohpc.swmed.edu biohpc-help@utsouthwestern.edu 1 Updated for 2017-11-18 Study Resources : A Free Book 500+ pages * Some of the materials covered

More information

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions CSE 390a Lecture 3 Multi-user systems; remote login; editors; users/groups; permissions slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson http://www.cs.washington.edu/390a/ 1

More information

CS197U: A Hands on Introduction to Unix

CS197U: A Hands on Introduction to Unix CS197U: A Hands on Introduction to Unix Lecture 3: UNIX Operating System Organization Tian Guo CICS, Umass Amherst 1 Reminders Assignment 2 is due THURSDAY 09/24 at 3:45 pm Directions are on the website

More information

Introduction to Linux

Introduction 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 information

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK Cloud Computing and Unix: An Introduction Dr. Sophie Shaw University of Aberdeen, UK s.shaw@abdn.ac.uk Aberdeen London Exeter What We re Going To Do Why Unix? Cloud Computing Connecting to AWS Introduction

More information

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

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

More information

CSE 303 Lecture 4. users/groups; permissions; intro to shell scripting. read Linux Pocket Guide pp , 25-27, 61-65, , 176

CSE 303 Lecture 4. users/groups; permissions; intro to shell scripting. read Linux Pocket Guide pp , 25-27, 61-65, , 176 CSE 303 Lecture 4 users/groups; permissions; intro to shell scripting read Linux Pocket Guide pp. 19-20, 25-27, 61-65, 118-119, 176 slides created by Marty Stepp http://www.cs.washington.edu/303/ 1 Lecture

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Kisik Jeong (kisik@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating

More information

UNIT 9 Introduction to Linux and Ubuntu

UNIT 9 Introduction to Linux and Ubuntu AIR FORCE ASSOCIATION S CYBERPATRIOT NATIONAL YOUTH CYBER EDUCATION PROGRAM UNIT 9 Introduction to Linux and Ubuntu Learning Objectives Participants will understand the basics of Linux, including the nature,

More information

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala Linux Training for New Users of Cluster Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala pakala@uga.edu 1 Overview GACRC Linux Operating System Shell, Filesystem, and Common

More information

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK Cloud Computing and Unix: An Introduction Dr. Sophie Shaw University of Aberdeen, UK s.shaw@abdn.ac.uk Aberdeen London Exeter What We re Going To Do Why Unix? Cloud Computing Connecting to AWS Introduction

More information

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

Unix Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : December, More documents are freely available at PythonDSP Unix Guide Meher Krishna Patel Created on : Octorber, 2017 Last updated : December, 2017 More documents are freely available at PythonDSP Table of contents Table of contents i 1 Unix commands 1 1.1 Unix

More information