Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to the Command Line for Data Analysts Gus Cavanaugh

Similar presentations


Presentation on theme: "Introduction to the Command Line for Data Analysts Gus Cavanaugh"— Presentation transcript:

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

2 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

3 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

4 My ask of you Introduce yourself Ask Questions… Through the webinar
Through the meetup: Analytics-Office-Hours/ Via On On to the material!

5 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)

6 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

7 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: Git: I recommend you install Git as you’ll want to get comfortable using Git for general programming tasks

8 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

9 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

10 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

11 Best Free Resources to Learn More
1) Learn the Command Line the Hard Way: 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: One handy reference to keep nearby 3) Learn X in Y Minutes (Bash): Excellent introductory tutorial on bash with code you can run directly 4) Linux Journey: Free online course I just started


Download ppt "Introduction to the Command Line for Data Analysts Gus Cavanaugh"

Similar presentations


Ads by Google