Command Line Basics for Drupal Site Builders
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 - - 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
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
@sparklingrobots
PANTHEON.IOWho this talk is for
AGENDA
05/ Version control 04/ Text editors 03/ Files & file permissions 02/ Fundamental concepts 01/ Why command-line tools? 06/ WP-CLI
@sparklingrobots
PANTHEON.IOWhat is the command line?
@sparklingrobots
PANTHEON.IOWhat is the command line?
@sparklingrobots
The command line is, at its heart, simply a place where you type commands to the computer.
David Baumgold
@sparklingrobots
PANTHEON.IOGUI vs. CLI
@sparklingrobots
Why learn the command line?
Speed Automation Efficiency Looking Awesome
@sparklingrobots
@sparklingrobots
PANTHEON.IOBe careful.
@sparklingrobots
PANTHEON.IODon’t panic.
But:
@sparklingrobots
PANTHEON.IOCommand-line fundamentals
THE VERY, VERY, VERY BASICS
@sparklingrobots
Mac OS X: Applications > Utilities > Terminal Linux: Applications > System > Terminal
How to open the terminal:
@sparklingrobots
@sparklingrobots
Anatomy of a Command
https://www.learnenough.com/command-line-tutorial
@sparklingrobots
@sparklingrobots
@sparklingrobots
PANTHEON.IOpwd print working directory
@sparklingrobots
PANTHEON.IOls Lists files in a directory
@sparklingrobots
PANTHEON.IOls -al
- a = all
- l = long format
@sparklingrobots
PANTHEON.IO????
@sparklingrobots
PANTHEON.IORead Write eXecute
Owner Group Everyone else
@sparklingrobots
PANTHEON.IO@sparklingrobots
PANTHEON.IO. = Current directory .. = Parent directory
@sparklingrobots
PANTHEON.IOhome = ~ root = /
@sparklingrobots
PANTHEON.IOcd modules/contrib change into directory
@sparklingrobots
PANTHEON.IOcp wp-config-sample.php wp-config.php
copy
@sparklingrobots
PANTHEON.IOrm style.css remove file (or directory)
@sparklingrobots
PANTHEON.IOmkdir child-theme make directory
@sparklingrobots
PANTHEON.IO- 1. Google it.
- 2. Check the man page (man ls).
- 3. Try -h, --help, -v
(php --help).
How to learn more
@sparklingrobots
PANTHEON.IOText Editors
@sparklingrobots
Text Editors
- vim
- nano
- emacs
- ....and many more!
@sparklingrobots
PANTHEON.IOThe best text editor is the one you use.
@sparklingrobots
PANTHEON.IOnano
- pen nano
@sparklingrobots
PANTHEON.IO@sparklingrobots
PANTHEON.IOConnecting to other computers
@sparklingrobots
PANTHEON.IOFTP vs. SFTP vs. SSH
@sparklingrobots
PANTHEON.IOFile Transfer Protocol vs. Secure File Transfer Protocol
@sparklingrobots
PANTHEON.IOSecure File Transfer Protocol vs. Secure Shell
@sparklingrobots
PANTHEON.IOSSH Keys
https://pantheon.io/docs/ssh-keys
@sparklingrobots
PANTHEON.IOVersion Control
@sparklingrobots
MyCoolProject.txt MyCoolProject2.txt MyCoolProject3.txt MyCoolProject3b.txt MyCoolProject3bTara.txt MyCoolProject3bTaraSteve.txt MyCoolProjectFinal.txt MyCoolProjectFinalFinal.txt MyCoolProjectFinalFinal2LastChangeIPr
- mise.txt
@sparklingrobots
PANTHEON.IOGit
@sparklingrobots
PANTHEON.IOOH MY!
https://git-scm.com/about
What is Drush?
@sparklingrobots
PANTHEON.IOdrush user-create tara
- -mail="tara.king@pantheon.io"
@sparklingrobots
PANTHEON.IOdrush user-add-role “admin” tara.king@pantheon.io
@sparklingrobots
PANTHEON.IOdrush uli
@sparklingrobots
PANTHEON.IOdrush dl claro
@sparklingrobots
PANTHEON.IOdrush en claro -y
@sparklingrobots
PANTHEON.IOdrush config-import
@sparklingrobots
PANTHEON.IOdrush up drupal
@sparklingrobots
PANTHEON.IOdrush sql-sanitize
- -sanitize-password=no
@sparklingrobots
PANTHEON.IOwp search-replace "://test.example.com" "://live.example.com"
- -all-tables --verbose
@sparklingrobots
PANTHEON.IOwp db size --tables
@sparklingrobots
PANTHEON.IOHow to Install Drush
@sparklingrobots
PANTHEON.IOhttps://drushcommands.com/
@sparklingrobots
PANTHEON.IOUsing Drush remotely
@sparklingrobots
PANTHEON.IOCustom commands
What comes next?
@sparklingrobots
- Composer!
- Drupal Console!
- And so much more!
@sparklingrobots
PANTHEON.IOhttp://bit.ly/DCGLO-CLI
@sparklingrobots
PANTHEON.IOCredit: Kyle Taylor, Sarah German, Jose Castaneda
Thank You!
Tara King Developer Outreach Manager, Pantheon @sparklingrobots
@sparklingrobots
PANTHEON.IOTUTORIALS: 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/