Command Line Basics for Drupal Site Builders Hi, I'm Tara Developer - - PowerPoint PPT Presentation

command line basics for drupal site builders hi i m tara
SMART_READER_LITE
LIVE PREVIEW

Command Line Basics for Drupal Site Builders Hi, I'm Tara Developer - - PowerPoint PPT Presentation

Command Line Basics for Drupal Site Builders Hi, I'm Tara Developer Outreach Manager at Pantheon @sparklingrobots PANTHEON.IO tara.king@pantheon.io Some things I enjoy away from the computer: Books: https://is.gd/tara_books


slide-1
SLIDE 1

Command Line Basics for Drupal Site Builders

slide-2
SLIDE 2 PANTHEON.IO

Hi, I'm Tara

Developer Outreach Manager at Pantheon

  • @sparklingrobots
  • tara.king@pantheon.io

Some things I enjoy away from the computer: ○ Books: https://is.gd/tara_books ○ MañanaCon ○ Diversity, inclusion & equity in FOSS

slide-3
SLIDE 3

@sparklingrobots

PANTHEON.IO

Who this talk is for

slide-4
SLIDE 4 PANTHEON.IO

AGENDA

05/ Version control 04/ Text editors 03/ Files & file permissions 02/ Fundamental concepts 01/ Why command-line tools? 06/ WP-CLI

slide-5
SLIDE 5

@sparklingrobots

PANTHEON.IO

What is the command line?

slide-6
SLIDE 6

@sparklingrobots

PANTHEON.IO

What is the command line?

slide-7
SLIDE 7
slide-8
SLIDE 8

@sparklingrobots

slide-9
SLIDE 9

The command line is, at its heart, simply a place where you type commands to the computer.

David Baumgold

slide-10
SLIDE 10

@sparklingrobots

PANTHEON.IO

GUI vs. CLI

slide-11
SLIDE 11 PANTHEON.IO

@sparklingrobots

Why learn the command line?

Speed Automation Efficiency Looking Awesome

฀฀

@sparklingrobots

slide-12
SLIDE 12

@sparklingrobots

PANTHEON.IO

Be careful.

slide-13
SLIDE 13

@sparklingrobots

PANTHEON.IO

Don’t panic.

But:

slide-14
SLIDE 14

@sparklingrobots

PANTHEON.IO

Command-line fundamentals

THE VERY, VERY, VERY BASICS

slide-15
SLIDE 15 PANTHEON.IO

@sparklingrobots

Mac OS X: Applications > Utilities > Terminal Linux: Applications > System > Terminal

How to open the terminal:

@sparklingrobots

slide-16
SLIDE 16 PANTHEON.IO

@sparklingrobots

slide-17
SLIDE 17 PANTHEON.IO

Anatomy of a Command

https://www.learnenough.com/command-line-tutorial

@sparklingrobots

slide-18
SLIDE 18 PANTHEON.IO

@sparklingrobots

slide-19
SLIDE 19

@sparklingrobots

PANTHEON.IO

pwd print working directory

slide-20
SLIDE 20

@sparklingrobots

PANTHEON.IO

ls Lists files in a directory

slide-21
SLIDE 21

@sparklingrobots

PANTHEON.IO

ls -al

  • a = all
  • l = long format
slide-22
SLIDE 22

@sparklingrobots

PANTHEON.IO

????

slide-23
SLIDE 23

@sparklingrobots

PANTHEON.IO

Read Write eXecute

Owner Group Everyone else

slide-24
SLIDE 24

@sparklingrobots

PANTHEON.IO
slide-25
SLIDE 25

@sparklingrobots

PANTHEON.IO

. = Current directory .. = Parent directory

slide-26
SLIDE 26

@sparklingrobots

PANTHEON.IO

home = ~ root = /

slide-27
SLIDE 27

@sparklingrobots

PANTHEON.IO

cd modules/contrib change into directory

slide-28
SLIDE 28

@sparklingrobots

PANTHEON.IO

cp wp-config-sample.php wp-config.php

copy

slide-29
SLIDE 29

@sparklingrobots

PANTHEON.IO

rm style.css remove file (or directory)

slide-30
SLIDE 30

@sparklingrobots

PANTHEON.IO

mkdir child-theme make directory

slide-31
SLIDE 31

@sparklingrobots

PANTHEON.IO
  • 1. Google it.
  • 2. Check the man page (man ls).
  • 3. Try -h, --help, -v

(php --help).

How to learn more

slide-32
SLIDE 32

@sparklingrobots

PANTHEON.IO

Text Editors

slide-33
SLIDE 33 PANTHEON.IO

@sparklingrobots

Text Editors

  • vim
  • nano
  • emacs
  • ....and many more!
slide-34
SLIDE 34

@sparklingrobots

PANTHEON.IO

The best text editor is the one you use.

slide-35
SLIDE 35

@sparklingrobots

PANTHEON.IO

nano

  • pen nano
slide-36
SLIDE 36

@sparklingrobots

PANTHEON.IO
slide-37
SLIDE 37

@sparklingrobots

PANTHEON.IO

Connecting to other computers

slide-38
SLIDE 38

@sparklingrobots

PANTHEON.IO

FTP vs. SFTP vs. SSH

slide-39
SLIDE 39

@sparklingrobots

PANTHEON.IO

File Transfer Protocol vs. Secure File Transfer Protocol

slide-40
SLIDE 40

@sparklingrobots

PANTHEON.IO

Secure File Transfer Protocol vs. Secure Shell

slide-41
SLIDE 41

@sparklingrobots

PANTHEON.IO

SSH Keys

https://pantheon.io/docs/ssh-keys

slide-42
SLIDE 42

@sparklingrobots

PANTHEON.IO

Version Control

slide-43
SLIDE 43 PANTHEON.IO

@sparklingrobots

MyCoolProject.txt MyCoolProject2.txt MyCoolProject3.txt MyCoolProject3b.txt MyCoolProject3bTara.txt MyCoolProject3bTaraSteve.txt MyCoolProjectFinal.txt MyCoolProjectFinalFinal.txt MyCoolProjectFinalFinal2LastChangeIPr

  • mise.txt
slide-44
SLIDE 44

@sparklingrobots

PANTHEON.IO

Git

slide-45
SLIDE 45

@sparklingrobots

PANTHEON.IO

OH MY!

https://git-scm.com/about

slide-46
SLIDE 46 PANTHEON.IO

What is Drush?

slide-47
SLIDE 47

@sparklingrobots

PANTHEON.IO

drush user-create tara

  • -mail="tara.king@pantheon.io"
slide-48
SLIDE 48

@sparklingrobots

PANTHEON.IO

drush user-add-role “admin” tara.king@pantheon.io

slide-49
SLIDE 49

@sparklingrobots

PANTHEON.IO

drush uli

slide-50
SLIDE 50

@sparklingrobots

PANTHEON.IO

drush dl claro

slide-51
SLIDE 51

@sparklingrobots

PANTHEON.IO

drush en claro -y

slide-52
SLIDE 52

@sparklingrobots

PANTHEON.IO

drush config-import

slide-53
SLIDE 53

@sparklingrobots

PANTHEON.IO

drush up drupal

slide-54
SLIDE 54

@sparklingrobots

PANTHEON.IO

drush sql-sanitize

  • -sanitize-password=no
slide-55
SLIDE 55

@sparklingrobots

PANTHEON.IO

wp search-replace "://test.example.com" "://live.example.com"

  • -all-tables --verbose
slide-56
SLIDE 56

@sparklingrobots

PANTHEON.IO

wp db size --tables

slide-57
SLIDE 57

@sparklingrobots

PANTHEON.IO

How to Install Drush

slide-58
SLIDE 58

@sparklingrobots

PANTHEON.IO

https://drushcommands.com/

slide-59
SLIDE 59

@sparklingrobots

PANTHEON.IO

Using Drush remotely

slide-60
SLIDE 60

@sparklingrobots

PANTHEON.IO

Custom commands

slide-61
SLIDE 61 PANTHEON.IO

What comes next?

@sparklingrobots

  • Composer!
  • Drupal Console!
  • And so much more!
slide-62
SLIDE 62

@sparklingrobots

PANTHEON.IO

http://bit.ly/DCGLO-CLI

slide-63
SLIDE 63

@sparklingrobots

PANTHEON.IO

Credit: Kyle Taylor, Sarah German, Jose Castaneda

slide-64
SLIDE 64

Thank You!

Tara King Developer Outreach Manager, Pantheon @sparklingrobots

slide-65
SLIDE 65

@sparklingrobots

PANTHEON.IO

TUTORIALS: https://www.davidbaumgold.com/tutorials/command-li ne https://www.learnenough.com/command-line-tutorial FIND THE TERMINAL: https://blog.teamtreehouse.com/introduction-to-the-ma c-os-x-command-line (Mac OS X) https://www.youtube.com/watch?v=rLayF5HMHIg (Ubuntu) NAVIGATION: https://www.davidbaumgold.com/tutorials/command-li ne/#moving-around-the-... ROOT: http://www.linfo.org/root_directory.html HOME: https://www.quora.com/What-is-the-difference-between

  • the-Home-directory-...

SSH: http://blog.robertelder.org/what-is-ssh/ VERSION CONTROL: https://betterexplained.com/articles/a-visual-guide-to-v ersion-control/ TEXT EDITOR: https://www.howtogeek.com/howto/42980/the-beginne rs-guide-to-nano-the-li... SSH KEYS: https://help.github.com/articles/generating-a-new-ssh-k ey-and-adding-it-... DRUSH: https://drushcommands.com/ INSTALL DRUSH: https://docs.drush.org/en/8.x/install/

Resources: