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 ○ MañanaCon ○ Diversity, inclusion & equity in FOSS
@sparklingrobots PANTHEON.IO Who this talk is for
AGENDA 01/ Why command-line tools? 02/ Fundamental concepts PANTHEON.IO 03/ Files & file permissions 04/ Text editors 05/ Version control 06/ WP-CLI
@sparklingrobots PANTHEON.IO What is the command line?
@sparklingrobots PANTHEON.IO What 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.IO GUI vs. CLI
@sparklingrobots @sparklingrobots Why learn the command line? Speed PANTHEON.IO Efficiency Automation Looking Awesome
@sparklingrobots PANTHEON.IO Be careful.
@sparklingrobots PANTHEON.IO But: Don’t panic.
@sparklingrobots PANTHEON.IO THE VERY, VERY, VERY BASICS Command-line fundamentals
@sparklingrobots @sparklingrobots How to open the terminal: Mac OS X: PANTHEON.IO Applications > Utilities > Terminal Linux: Applications > System > Terminal
@sparklingrobots PANTHEON.IO
@sparklingrobots Anatomy of a Command PANTHEON.IO https://www.learnenough.com/command-line-tutorial
@sparklingrobots PANTHEON.IO
@sparklingrobots pwd PANTHEON.IO p rint w orking d irectory
@sparklingrobots ls PANTHEON.IO Lists files in a directory
@sparklingrobots ls -al -a = all PANTHEON.IO -l = long format
@sparklingrobots ???? PANTHEON.IO
@sparklingrobots Owner Group Everyone else PANTHEON.IO Read Write eXecute
@sparklingrobots PANTHEON.IO
@sparklingrobots . = Current directory PANTHEON.IO .. = Parent directory
@sparklingrobots root = / PANTHEON.IO home = ~
@sparklingrobots cd modules/contrib PANTHEON.IO c hange into d irectory
@sparklingrobots cp wp-config-sample.php wp-config.php PANTHEON.IO c o p y
@sparklingrobots rm style.css PANTHEON.IO r e m ove file (or directory)
@sparklingrobots mkdir child-theme PANTHEON.IO m a k e dir ectory
@sparklingrobots How to learn more 1. Google it. PANTHEON.IO 2. Check the man page ( man ls ). 3. Try -h , --help , -v ( php --help ) .
@sparklingrobots PANTHEON.IO Text Editors
@sparklingrobots Text Editors PANTHEON.IO ● vim ● nano ● emacs ● ....and many more!
@sparklingrobots PANTHEON.IO The best text editor is the one you use.
@sparklingrobots nano PANTHEON.IO open nano
@sparklingrobots PANTHEON.IO
@sparklingrobots PANTHEON.IO Connecting to other computers
@sparklingrobots PANTHEON.IO FTP vs. SFTP vs. SSH
@sparklingrobots F ile T ransfer P rotocol PANTHEON.IO vs. S ecure F ile T ransfer Protocol
@sparklingrobots S ecure F ile T ransfer P rotocol PANTHEON.IO vs. S ecure Sh ell
@sparklingrobots PANTHEON.IO SSH Keys https://pantheon.io/docs/ssh-keys
@sparklingrobots PANTHEON.IO Version Control
@sparklingrobots MyCoolProject.txt MyCoolProject2.txt MyCoolProject3.txt MyCoolProject3b.txt PANTHEON.IO MyCoolProject3bTara.txt MyCoolProject3bTaraSteve.txt MyCoolProjectFinal.txt MyCoolProjectFinalFinal.txt MyCoolProjectFinalFinal2LastChangeIPr omise.txt
@sparklingrobots PANTHEON.IO Git
@sparklingrobots PANTHEON.IO OH MY! https://git-scm.com/about
PANTHEON.IO What is Drush?
@sparklingrobots drush user-create tara PANTHEON.IO --mail="tara.king@pantheon.io"
@sparklingrobots drush user-add-role PANTHEON.IO “admin” tara.king@pantheon.io
@sparklingrobots PANTHEON.IO drush uli
@sparklingrobots drush dl claro PANTHEON.IO
@sparklingrobots drush en claro -y PANTHEON.IO
@sparklingrobots PANTHEON.IO drush config-import
@sparklingrobots drush up drupal PANTHEON.IO
@sparklingrobots drush sql-sanitize PANTHEON.IO --sanitize-password=no
@sparklingrobots wp search-replace "://test.example.com" PANTHEON.IO "://live.example.com" --all-tables --verbose
@sparklingrobots wp db size --tables PANTHEON.IO
@sparklingrobots PANTHEON.IO How to Install Drush
@sparklingrobots PANTHEON.IO https://drushcommands.com/
@sparklingrobots PANTHEON.IO Using Drush remotely
@sparklingrobots PANTHEON.IO Custom commands
@sparklingrobots What comes next? Composer! ● Drupal Console! ● PANTHEON.IO And so much more! ●
@sparklingrobots PANTHEON.IO http://bit.ly/DCGLO-CLI
@sparklingrobots Credit: PANTHEON.IO Kyle Taylor, Sarah German, Jose Castaneda
Thank You! Tara King Developer Outreach Manager, Pantheon @sparklingrobots
@sparklingrobots Resources: TUTORIALS : HOME : https://www.davidbaumgold.com/tutorials/command-li https://www.quora.com/What-is-the-difference-between ne -the-Home-directory-... https://www.learnenough.com/command-line-tutorial SSH : http://blog.robertelder.org/what-is-ssh/ FIND THE TERMINAL: VERSION CONTROL : PANTHEON.IO https://blog.teamtreehouse.com/introduction-to-the-ma https://betterexplained.com/articles/a-visual-guide-to-v c-os-x-command-line (Mac OS X) ersion-control/ https://www.youtube.com/watch?v=rLayF5HMHIg TEXT EDITOR: (Ubuntu) https://www.howtogeek.com/howto/42980/the-beginne rs-guide-to-nano-the-li... NAVIGATION : https://www.davidbaumgold.com/tutorials/command-li SSH KEYS: ne/#moving-around-the-... https://help.github.com/articles/generating-a-new-ssh-k ey-and-adding-it-... ROOT : http://www.linfo.org/root_directory.html DRUSH: https://drushcommands.com/ INSTALL DRUSH: https://docs.drush.org/en/8.x/install/
Recommend
More recommend