SlideShare a Scribd company logo
Code Tacoma:
Command Line Basics
Andrea Urban
September 8, 2018
Please sit next to someone with an operating system
similar to yours.
Agenda
1. Installation and Set up: 15 minutes
2. Introductions
3. Introduction to the Command Line
4. Basic Commands
Installation and Setup
Mac/unix/linux: Open terminal
Windows: 3 options
● If you want to be a developer, but not interested in python (fastest install): Install Git Tools for Windows from the
following URL: https://git-scm.com/download/win. When prompted in the installation wizard, select: "Use Git and
optional Unix tools for the Windows Command Prompt". Open the git bash.
● If you want to learn python too: Install anaconda https://conda.io/docs/user-guide/install/windows.html. Don't do
miniconda; do the full anaconda installer. Choose Python 3.6. Open the anaconda prompt and type ‘conda create -n
main m2-base’. Say y to all queries. When Install is complete type “conda activate main” (To practice command line
commands in future, you’ll need to type last command every time you reopen conda prompt.
● Big installation (not recommended): Install cygwin https://www.cygwin.com/ (a virtual unix machine for windows). I
would not recommend this option because it's a really large program. However, if it's already installed, then you're
ready.
When you’re ready:
Compare your screen to your neighbor’s.
Check with another neighbor.
Ground Rules
If you have any trouble sounding condescending, find a UNIX
user to show you how it's done.
— Scott Adams, Dilbert Cartoonist
● Don’t act like a “UNIX user”.
● Mission: Learn UNIX tools and help others learn them too.
Introductions
Who am I?
● Andrea Urban
● Data scientist
● I mostly work in Python and SQL in Windows. In a past life, I used a Unix
machine coding in Fortran.
Who are you?
● Name
● Why are you interested in learning command line?
● Do you know any programming languages?
CLI: Command Line Interface
A text interface for interacting with a computer.
GUI: Graphical User Interface
Use mouse to interact with
computer.
Drag windows and files around.
CLI:
Command
Line Interface
GUI: Graphical
User Interface
Why is it useful to learn the command line?
Bulk actions - Ex: Delete all the jpg’s in a folder
Connecting to remote servers
Many remote servers only allow you to connect via a terminal.
Remote server interface gui could be slow compared to terminal.
Any other reasons?
Let’s get started!
The prompt
What do you see in your terminal?
Puffy-Cloud:~ Andrea$
● Puffy-Cloud = my computer’s name
● ~ = where I am located in my file system
● Andrea = my user name
What your prompt may look like…
>
$
Any others?
pwd: Where are we?
> pwd
What do you see?
pwd = print working directory
Tells you where you are in your file system.
cd: Take me home.
“cd” stands for “Change Directories”
> cd
Take me to my home directory
~ : refers to home directory (> cd ~ also takes user home)
(Joke: There is no place like ~)
What output do you see?
> cd ..
Take me up a directory
What output do you see? How can you check if this worked?
cd: Take me home.
“cd” stands for “Change Directories”
> cd
> cd ../..
Take me up two directories
Be sure to check your work.
Self-check:
How do I go home?
How do I go up three directories?
ls: Take a look around
> cd First go back home.
ls stands for “list” contents
> ls
List current directory’s contents
What do you see?
> ls ..
Lists contents of directory above current directory
Now what do you see?
ls: Take a look around
> cd
> ls -l
Show long format of contents of directory
> man ls
Show manual pages for the ls command. Use arrow keys to navigate.
Useful for learning about new flags (-l is a flag)
Use the man pages to find out what ls -l is showing you.
Self-check
What will you see if you try the following command? Take a guess before typing it
in the terminal
> ls ../..
How can I print out the file size in human-readable format, i.e., 3.5K instead of
3536 bytes?
(Hint: take a look at the man page for ls)
Hidden Files
> cd
> ls -a
List ALL the contents of the current directory, including hidden files
Hidden files generally start with a period “.”
The hidden files: “.” and “..” represent the current and parent directory
What do you expect to happen when you type ”ls .” ?
Manipulating Files
mkdir: Build something new
Make a directory
> cd
> mkdir workshop
> ls workshop
What does this last command do?
Now, go into the new directory.
touch: Building another new thing
touch let’s you create new empty files easily
> cd workshop
> pwd
Output: ~/workshop
Make sure you are in the directory that you just created.
> ls
Verify that directory is empty
> touch this
> touch that
> touch other
Now what’s inside the directory?
Searching smart
Wildcards can be used in the command line.
> ls t*
Only list files starting with the letter t.
> ls *r
Only list files ending with the letter r.
Self-check
Only list files containing the letter “i”
Make another directory inside the workshop directory called “pets”
Put two new files in the directory called “cat” and “dog”
Check your work with a neighbor.
Did you accidentally put the cat and dog files in the
workshop directory instead of the pets directory?
rm: proceed with caution
(You know it’s serious when there’s a Star Wars gif.)
rm: proceed with caution
rm : remove file(s)
There is NO undo button or
command for rm
The most dangerous command
rm *
rm: Cleaning up mistakes
Go to the workshop directory. Create files “cat” and “dog” in this directory (unless
they are already there).
> pwd (should be “workshop”)
> touch cat
> touch dog
> ls (Verify that cat and dog are new files)
> rm cat
> ls (Verify that cat is now gone)
> rm dog
> ls (Verify that dog is now gone)
rmdir: remove directory
rmdir is rm for directories. Directories must be empty.
> cd
> cd workshop
> rmdir pets (will delete if directory is empty, otherwise keep going)
> cd pets
> rm *
> cd ..
> rmdir pets
> ls
pets directory should be gone
> and >> (not the prompt)
> ls > files.txt
Takes output of ls command and stores it in the file “files.txt”
> less files.txt
View the contents of “files.txt”
Use “q” to exit the view.
> ls >> files.txt
Append the output of the ls command to the file “files.txt”
> less files.txt
q to quit
cp: Copy and Paste in one command
You must indicate both the from location and the to
location
> cd
> cd workshop
> cp files.txt files2.txt
Take the file named files.txt and make a
copy of it called files2.txt
> ls
Verify that files2.txt was created.
How can I verify that files2.txt is in fact the same
as files.txt?
cp: Copy and Paste in one command
You must indicate both the from location and the to
location
> mkdir file_folder
> cp files2.txt file_folder/files3.txt
Take files2.txt, make a copy of it named
files3.txt and place it in the file_folder
directory.
> ls
> ls file_folder
mv: Moving files.
mv: move a file from one location to the other. Must specify both locations.
> cd
> cd workshop
> cd file_folder
> ls
> mv files3.txt ../files4.txt
> ls
> ls ..
> cd ..
> mv files4.txt file_folder
If no new filename is specified when moving to a new directory, then keep the original filename.
WARNING!
cp and mv will write over files that exist of the same name.
They behave just like rm. No mercy.
Self-check
Remove the file_folder directory and all its contents
Remove .txt files from the workshop directory in one step
Move “this” and “that” files to a new directory called “things”
Congratulations!!
Fun things to try
> whoami
> hostname
> clear
> reboot
> sudo reboot

More Related Content

What's hot

Linux final exam
Linux final examLinux final exam
Linux final exam
Andrew Ibrahim
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
SuKyeong Jang
 
Linux midterm quiz
Linux midterm quizLinux midterm quiz
Linux midterm quiz
Andrew Ibrahim
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
swtjerin4u
 
UNIX Command Cheat Sheets
UNIX Command Cheat SheetsUNIX Command Cheat Sheets
UNIX Command Cheat Sheets
Prashanth Kumar
 
11 unix osx_commands
11 unix osx_commands11 unix osx_commands
11 unix osx_commands
Macinfosoft
 
Linux intro 1 definitions
Linux intro 1  definitionsLinux intro 1  definitions
Linux intro 1 definitions
Giovanni Marco Dall'Olio
 
Piping into-php
Piping into-phpPiping into-php
Piping into-php
Shaun Morrow
 
Pipes and filters
Pipes and filtersPipes and filters
Pipes and filters
bhatvijetha
 
Terminal commands ubuntu 2
Terminal commands ubuntu 2Terminal commands ubuntu 2
Terminal commands ubuntu 2
raj upadhyay
 
Unix And C
Unix And CUnix And C
Unix And C
Dr.Ravi
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
Dr.Ravi
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 
Unix
UnixUnix
Terminalcommandsubuntu1 170123133631 (1)
Terminalcommandsubuntu1 170123133631 (1)Terminalcommandsubuntu1 170123133631 (1)
Terminalcommandsubuntu1 170123133631 (1)
SteveEvans551344
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
shanmuga rajan
 
Vi Editor
Vi EditorVi Editor
Text mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformaticsText mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformatics
BITS
 
Productivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsProductivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformatics
BITS
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOS
AdamFallon4
 

What's hot (20)

Linux final exam
Linux final examLinux final exam
Linux final exam
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
Linux midterm quiz
Linux midterm quizLinux midterm quiz
Linux midterm quiz
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
UNIX Command Cheat Sheets
UNIX Command Cheat SheetsUNIX Command Cheat Sheets
UNIX Command Cheat Sheets
 
11 unix osx_commands
11 unix osx_commands11 unix osx_commands
11 unix osx_commands
 
Linux intro 1 definitions
Linux intro 1  definitionsLinux intro 1  definitions
Linux intro 1 definitions
 
Piping into-php
Piping into-phpPiping into-php
Piping into-php
 
Pipes and filters
Pipes and filtersPipes and filters
Pipes and filters
 
Terminal commands ubuntu 2
Terminal commands ubuntu 2Terminal commands ubuntu 2
Terminal commands ubuntu 2
 
Unix And C
Unix And CUnix And C
Unix And C
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Unix
UnixUnix
Unix
 
Terminalcommandsubuntu1 170123133631 (1)
Terminalcommandsubuntu1 170123133631 (1)Terminalcommandsubuntu1 170123133631 (1)
Terminalcommandsubuntu1 170123133631 (1)
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 
Text mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformaticsText mining on the command line - Introduction to linux for bioinformatics
Text mining on the command line - Introduction to linux for bioinformatics
 
Productivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformaticsProductivity tips - Introduction to linux for bioinformatics
Productivity tips - Introduction to linux for bioinformatics
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOS
 

Similar to Code tacoma command_line

Linux_Commands.pdf
Linux_Commands.pdfLinux_Commands.pdf
Linux_Commands.pdf
MarsMox
 
Linux Command.pptx
Linux Command.pptxLinux Command.pptx
Linux Command.pptx
SaileshB5
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
BITS
 
Linux
LinuxLinux
Terminal Commands (Linux - ubuntu) (part-1)
Terminal Commands  (Linux - ubuntu) (part-1)Terminal Commands  (Linux - ubuntu) (part-1)
Terminal Commands (Linux - ubuntu) (part-1)
raj upadhyay
 
Assignment OS LAB 2022
Assignment OS LAB 2022Assignment OS LAB 2022
Assignment OS LAB 2022
INFOTAINMENTCHANNEL1
 
Linux commands
Linux commandsLinux commands
Linux commands
Meenu Chopra
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
southees
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
Sudharsan S
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
vamsikrishna204239
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
vamsikrishna204239
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdf
CesleySCruz
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
Dr.Ravi
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
Hanan Nmr
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
MAGNA COLLEGE OF ENGINEERING
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Shakeel Shafiq
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
 
linux system administration for system admin jobs
linux  system administration for system admin jobslinux  system administration for system admin jobs
linux system administration for system admin jobs
Bibhushanrabha
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In Practice
Qasim Khawaja
 

Similar to Code tacoma command_line (20)

Linux_Commands.pdf
Linux_Commands.pdfLinux_Commands.pdf
Linux_Commands.pdf
 
Linux Command.pptx
Linux Command.pptxLinux Command.pptx
Linux Command.pptx
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
 
Linux
LinuxLinux
Linux
 
Terminal Commands (Linux - ubuntu) (part-1)
Terminal Commands  (Linux - ubuntu) (part-1)Terminal Commands  (Linux - ubuntu) (part-1)
Terminal Commands (Linux - ubuntu) (part-1)
 
Assignment OS LAB 2022
Assignment OS LAB 2022Assignment OS LAB 2022
Assignment OS LAB 2022
 
Linux commands
Linux commandsLinux commands
Linux commands
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
Unix_QT.ppsx
Unix_QT.ppsxUnix_QT.ppsx
Unix_QT.ppsx
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdf
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
 
linux system administration for system admin jobs
linux  system administration for system admin jobslinux  system administration for system admin jobs
linux system administration for system admin jobs
 
Sls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In PracticeSls01 Lecture02 Linux In Practice
Sls01 Lecture02 Linux In Practice
 

Recently uploaded

Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 

Recently uploaded (20)

Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 

Code tacoma command_line

  • 1. Code Tacoma: Command Line Basics Andrea Urban September 8, 2018 Please sit next to someone with an operating system similar to yours.
  • 2. Agenda 1. Installation and Set up: 15 minutes 2. Introductions 3. Introduction to the Command Line 4. Basic Commands
  • 3. Installation and Setup Mac/unix/linux: Open terminal Windows: 3 options ● If you want to be a developer, but not interested in python (fastest install): Install Git Tools for Windows from the following URL: https://git-scm.com/download/win. When prompted in the installation wizard, select: "Use Git and optional Unix tools for the Windows Command Prompt". Open the git bash. ● If you want to learn python too: Install anaconda https://conda.io/docs/user-guide/install/windows.html. Don't do miniconda; do the full anaconda installer. Choose Python 3.6. Open the anaconda prompt and type ‘conda create -n main m2-base’. Say y to all queries. When Install is complete type “conda activate main” (To practice command line commands in future, you’ll need to type last command every time you reopen conda prompt. ● Big installation (not recommended): Install cygwin https://www.cygwin.com/ (a virtual unix machine for windows). I would not recommend this option because it's a really large program. However, if it's already installed, then you're ready. When you’re ready: Compare your screen to your neighbor’s. Check with another neighbor.
  • 4. Ground Rules If you have any trouble sounding condescending, find a UNIX user to show you how it's done. — Scott Adams, Dilbert Cartoonist ● Don’t act like a “UNIX user”. ● Mission: Learn UNIX tools and help others learn them too.
  • 5. Introductions Who am I? ● Andrea Urban ● Data scientist ● I mostly work in Python and SQL in Windows. In a past life, I used a Unix machine coding in Fortran. Who are you? ● Name ● Why are you interested in learning command line? ● Do you know any programming languages?
  • 6. CLI: Command Line Interface A text interface for interacting with a computer.
  • 7. GUI: Graphical User Interface Use mouse to interact with computer. Drag windows and files around.
  • 9. Why is it useful to learn the command line? Bulk actions - Ex: Delete all the jpg’s in a folder Connecting to remote servers Many remote servers only allow you to connect via a terminal. Remote server interface gui could be slow compared to terminal. Any other reasons?
  • 11. The prompt What do you see in your terminal? Puffy-Cloud:~ Andrea$ ● Puffy-Cloud = my computer’s name ● ~ = where I am located in my file system ● Andrea = my user name What your prompt may look like… > $ Any others?
  • 12. pwd: Where are we? > pwd What do you see? pwd = print working directory Tells you where you are in your file system.
  • 13. cd: Take me home. “cd” stands for “Change Directories” > cd Take me to my home directory ~ : refers to home directory (> cd ~ also takes user home) (Joke: There is no place like ~) What output do you see? > cd .. Take me up a directory What output do you see? How can you check if this worked?
  • 14. cd: Take me home. “cd” stands for “Change Directories” > cd > cd ../.. Take me up two directories Be sure to check your work. Self-check: How do I go home? How do I go up three directories?
  • 15. ls: Take a look around > cd First go back home. ls stands for “list” contents > ls List current directory’s contents What do you see? > ls .. Lists contents of directory above current directory Now what do you see?
  • 16. ls: Take a look around > cd > ls -l Show long format of contents of directory > man ls Show manual pages for the ls command. Use arrow keys to navigate. Useful for learning about new flags (-l is a flag) Use the man pages to find out what ls -l is showing you.
  • 17. Self-check What will you see if you try the following command? Take a guess before typing it in the terminal > ls ../.. How can I print out the file size in human-readable format, i.e., 3.5K instead of 3536 bytes? (Hint: take a look at the man page for ls)
  • 18. Hidden Files > cd > ls -a List ALL the contents of the current directory, including hidden files Hidden files generally start with a period “.” The hidden files: “.” and “..” represent the current and parent directory What do you expect to happen when you type ”ls .” ?
  • 20. mkdir: Build something new Make a directory > cd > mkdir workshop > ls workshop What does this last command do? Now, go into the new directory.
  • 21. touch: Building another new thing touch let’s you create new empty files easily > cd workshop > pwd Output: ~/workshop Make sure you are in the directory that you just created. > ls Verify that directory is empty > touch this > touch that > touch other Now what’s inside the directory?
  • 22. Searching smart Wildcards can be used in the command line. > ls t* Only list files starting with the letter t. > ls *r Only list files ending with the letter r.
  • 23. Self-check Only list files containing the letter “i” Make another directory inside the workshop directory called “pets” Put two new files in the directory called “cat” and “dog” Check your work with a neighbor.
  • 24. Did you accidentally put the cat and dog files in the workshop directory instead of the pets directory?
  • 25. rm: proceed with caution (You know it’s serious when there’s a Star Wars gif.)
  • 26. rm: proceed with caution rm : remove file(s) There is NO undo button or command for rm The most dangerous command rm *
  • 27. rm: Cleaning up mistakes Go to the workshop directory. Create files “cat” and “dog” in this directory (unless they are already there). > pwd (should be “workshop”) > touch cat > touch dog > ls (Verify that cat and dog are new files) > rm cat > ls (Verify that cat is now gone) > rm dog > ls (Verify that dog is now gone)
  • 28. rmdir: remove directory rmdir is rm for directories. Directories must be empty. > cd > cd workshop > rmdir pets (will delete if directory is empty, otherwise keep going) > cd pets > rm * > cd .. > rmdir pets > ls pets directory should be gone
  • 29. > and >> (not the prompt) > ls > files.txt Takes output of ls command and stores it in the file “files.txt” > less files.txt View the contents of “files.txt” Use “q” to exit the view. > ls >> files.txt Append the output of the ls command to the file “files.txt” > less files.txt q to quit
  • 30. cp: Copy and Paste in one command You must indicate both the from location and the to location > cd > cd workshop > cp files.txt files2.txt Take the file named files.txt and make a copy of it called files2.txt > ls Verify that files2.txt was created. How can I verify that files2.txt is in fact the same as files.txt?
  • 31. cp: Copy and Paste in one command You must indicate both the from location and the to location > mkdir file_folder > cp files2.txt file_folder/files3.txt Take files2.txt, make a copy of it named files3.txt and place it in the file_folder directory. > ls > ls file_folder
  • 32. mv: Moving files. mv: move a file from one location to the other. Must specify both locations. > cd > cd workshop > cd file_folder > ls > mv files3.txt ../files4.txt > ls > ls .. > cd .. > mv files4.txt file_folder If no new filename is specified when moving to a new directory, then keep the original filename.
  • 33. WARNING! cp and mv will write over files that exist of the same name. They behave just like rm. No mercy.
  • 34. Self-check Remove the file_folder directory and all its contents Remove .txt files from the workshop directory in one step Move “this” and “that” files to a new directory called “things”
  • 36. Fun things to try > whoami > hostname > clear > reboot > sudo reboot