Introduction to the Command Line for Data Analysts Gus Cavanaugh

Slides:



Advertisements
Similar presentations
Linux commands exercise 1. What do you need, if you try to these at home? You need to download and install Ubuntu Linux from the Internet – DVD is need.
Advertisements

Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
ENEE150: Discussion 1 Section 0104 Please Sit Down at a Computer and Login!
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
Linux+ Guide to Linux Certification, Second Edition
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Introduction to UNIX/Linux Exercises Dan Stanzione.
CS110/CS119 Introduction to Computing (Java)
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Cmsc 312 Operating Systems. UNIX? DOS – PC? VAX/VMS - mainframe Unix – PC, workstation, mainframe 1970 bell Lab For computer scientist? Why popular? Free.
CENT 305 Information Systems Security Linux Introduction.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
Linux+ Guide to Linux Certification Chapter Four Exploring Linux Filesystems.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
CPSC 217 T03 Week I Part #1: Unix and HELLO WORLD Hubert (Sathaporn) Hu.
Unix Shell Basics Edited from Greg Wilson's "Software Carpentry"
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Unix Commands PowerPoint Presentation developed for LS 560 Information Technology online class - University of Alabama by Debey Sklenar TENacious Cohort.
40 Years and Still Rocking the Terminal!
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
ENEE150: Discussion 1 Section 0104/0105 Please Sit Down at a Computer and Login!
Practical Kinetics Exercise 0: Getting Started Objectives: 1.Install Python and IPython Notebook 2.print “Hello World!”
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Learning Unix/Linux Based on slides from: Eric Bishop.
Intro to GNU/Linux See, Stallman? I said GNU. Are you happy now?
Linux Operating Systems Taking Control of the Terminal
Version Control Systems
By Jonathan Rinfret UNIX/LINUX By Jonathan Rinfret
Introduction to Unix for FreeSurfer Users
Version control and issue tracking options for IHE PCD
ENEE150 Discussion 01 Section 0101 Adam Wang.
Class Projects and Environment
Introduction to the Linux Commandline
Development Environment
CSC227: Operating Systems
Source Control Systems
Introduction to gathering and analyzing data via APIs Gus Cavanaugh
Department of Computer Engineering
Chapter 11 Command-Line Master Class
L – Modeling and Simulating Social Systems with MATLAB
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Lab Introduction Installing Python
3.4 User Interfaces This tutorial will give you a first-hand experience of: Navigating the directory structure in a CLI and an unfamiliar GUI Running the.
Some Linux Commands.
Excise Tasks CS 4640 Programming Languages for Web Applications
The Linux Operating System
Version Control Systems
Linux.
Lab 1 introduction, debrief
CSE 303 Concepts and Tools for Software Development
Introduction to computing
An introduction to version control systems with Git
An introduction to version control systems with Git
Intro to UNIX System and Homework 1
An introduction to version control systems with Git
College of Engineering
vim Basics Understanding And Using the vim Text Editor
Unix Talk #2 (sed).
Git started with git: 2018 edition
Inside a PMI Online Course
Yung-Hsiang Lu Purdue University
CSE 303 Concepts and Tools for Software Development
Introduction To CPSC 233 James Tam Event driven software
CSCI The UNIX System Editing files
Introduction To CPSC 233 James Tam Event driven software
Presentation transcript:

Introduction to the Command Line for Data Analysts Gus Cavanaugh Bash like a Bada$$ Introduction to the Command Line for Data Analysts Gus Cavanaugh

Agenda Brief overview of Data Analytics Office Hours Meetup Introduce the command line – what exactly is it? Why you should use the command line Which command line terminal should use and how you can install it Basic shell commands Top 5 Linux command line tools Best resources for learning more

Data Analytics Office Hours About me: Consultant trying to use data to solve business problems Meetups have been super helpful for learning technical subjects. But most are in-depth presentations on a topic. As such, I often quickly get lost. When I gave meetup talks, the best questions were often asked by individuals after the talk was over. Worse, they were usually foundational questions that meant the attendee missed out on a lot of value I want this meetup to be the place where those types of questions are asked. Presentations will be short or non-existent – just enough to cover some basic ideas. After that, it’s up to us. To put it crudely, I want this to be the forum for “stupid” questions. If one person asks one question they would be afraid to raise their hand and ask at a large meetup, this will have been a success

My ask of you Introduce yourself Ask Questions… Through the webinar Through the meetup: http://www.meetup.com/Data- Analytics-Office-Hours/ Via Email: gustafcavanaugh@gmail.com On Twitter: @GusCavanaugh On to the material!

What is the command line? A user interface for telling what your computer to do with textual commands Most of us use our operating system’s Graphical User Interface Linux and Mac OSX use derivations of the Bash shell Windows offers two command line options: CMD.exe Powershell You should use neither and download a Linux shell for Windows BASH: The standard shell for Linux distributions (BASH is an acronym but you don’t have to care what it stands for)

Why should you use the command line? Do you find yourself furiously using your mouse to repeat tasks? Do you wish there were a faster way to manipulate data, edit files, and run applications? (The shell is especially awesome for manipulating data) Do you want to know more about how your computer works? Do you want to be cool like this guy but not have to wear such a raggedy sweater? I mean seriously, they had all that technology in The Matrix but no one knew how to sew? C’mon. If you want to learn to program you need to learn how to use the command line first

Which shell should use? Mac Users – have a linux shell built-in You don’t have to install anything Windows Users – have to install external shell. Here are two options: Cygwin Cygwin is a linux shell for Windows that will give you most of the linux command line tools Git Git is a version control software that has nothing to do with the Linux shell. It just happens to ship with a shell program for Windows that works super well. I recommend you use this one Both Git and Cygwin come with GUI installers you can download here: Cygwin: https://cygwin.com/install.html Git: https://git-scm.com/download/win I recommend you install Git as you’ll want to get comfortable using Git for general programming tasks

Basic Shell Commands cd echo When using the shell you are navigating your computer with text rathe than with your mouse ls List all files in your current directory cd Change directory pwd Print the current working directory (where you are now) mkdir Make a new directory rm Delete a file (or directory if you add –r to the end) cat Show the contents of a file (print contents to the console) echo Print the following text to the console

Basic Shell Commands - Edit files Everything in Linux is about editing files. You’ll need a text editor. The two most popular (with a holy war between followers): VIM (I use VIM but only b/c that was what my first tutorial used) Emacs Both are command line text editors, e.g., you will open them with a command from the shell VIM Open and Close File Example: vim my_new_file.txt (opens file in command line console) :q (will quit file without saving) :wq (will save file and quit) VIM has many textual commands you can run inside of it Navigate through the file with keys: h,j,k,l Use Vim’s language to manipulate file Delete 3 words: d3w

Top 3 Linux Command Line Tools Grep/Awk/Sed Grep, Awk, and Sed are three separate command line applications that separate the children from the adults. Entire books have been written on each and I can’t do justice to them here. If you find yourself using Ctrl+F to find and replace multiple items in a text file, google Grep, Awk, and Sed and prepare to be awed Grep – match regular expression (grep “this_string_pattern” this_file) $ echo “hello world” | grep hello hello world Sed – a stream editor for manipulating text $ echo “hello world” | grep hello | sed s/hello/hola/ hola world Awk – programming language for manipulating text echo “hello world” | grep hello | sed s/hello/hola/ | awk ‘{print $1}’ hola

Best Free Resources to Learn More 1) Learn the Command Line the Hard Way: http://cli.learncodethehardway.org/ Zed Shaw’s awesome free course on learning the basics of the command line “the hard way…because there is no easy way” 2) Zed’s Command Line Cheat Sheet: http://cli.learncodethehardway.org/bash_cheat_sheet.pdf One handy reference to keep nearby 3) Learn X in Y Minutes (Bash): https://learnxinyminutes.com/docs/bash/ Excellent introductory tutorial on bash with code you can run directly 4) Linux Journey: https://linuxjourney.com/ Free online course I just started