On Github kepford / cracking-the-shell
Command line for the Drupaler
I can't think of many places I'd rather be Feburary than San Diego.Lead Architect
Publisher
Podcaster
Talk about Mediacurrent Talks about TWD Mention PodcastA shell is a user interface for access to an operating system's services.
A shell is a user interface for access to an operating system's services.Text command lines
Text command lines.Light on Resources
Concise
Scriptable for Automation
Commands are not obvious
Not beginner friendly
It's a Unix system!
~ Me
I have never regretted learning to use a command line tool.PHP
MySQL
Drupal
Composer
Node
Sass
The aren't going away. GUI's are great but CLI's make the world tick. Programming languages have them Popular web services like Github have them. And your computer has themMake your computer work in the way you want it to.
Configuration files.
Begin with a .
Live in ~
Symlink to a single directory
Track in Git
You can take your customizations with you.
Look at other dotfiles and steal liberally
Add small bits at a time and learn how to use them
Pointer to an actual file.
ln -s ~/.source_file ~/bin/dotfiles/target_file
A Symbolic link is any file that contains a reference to another file or directory in the form of an absolute or relative path.
Bash: the GNU Project's shell and is what I use.
ZSH: a shell designed for interactive use, although it is also a powerful scripting language
Fish: a smart and user-friendly command line shell for OS X, Linux, and the rest of the family.
I use BASH but there are other great and more powerful and fancy shells like ZSH and Fish.Add things to your path
export PATH=~/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin:/opt/local/bin
# Type $ someapp # Instead of $ ~/some/dir/drush/someapp.phpPATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. https://en.wikipedia.org/wiki/PATH_(variable)
Shortcuts for longer more complex commands.
alias h='history' alias l='ls -lhGt' # -l long listing, most recent first -G color alias g='git status'
function take() { mkdir -p "$1" cd "$1" }
Secure Socket Shell
Save yourself from trying to remember IP addresses and port numbers
Host server1 HostName 192.168.68.122 User napolean Port 22 Host server2 HostName 192.168.68.123 User kip Port 22
Don't put sensitive info in your Git repo if you plan to make it public.
Include this info in files outside the repo.
Don't use a GUI
Learn to use the commands
~/.gitconfig
excludesfile = ~/.gitignore Set colors for Git.
Per machine: ~/.gitconfig
Per project: .gitignore file in the repository
Per repo: .git/info/excludes
.git/hooks
Code linting.
Do tasks like copy your commit message to your clipboard?
#!/bin/bash # Create dayone entry with last commit message git log --pretty=format:"%s @${PWD##*/}%n%b" -1 HEAD | dayone new # Copy last commit message copied to clipboard git log --pretty=format:"%s %n%b" -1 HEAD | pbcopy
In your ~/.gitconfig
[alias] init = init --template ~/.git_template [init] templatedir = ~/.git_template
A good tutorial for setting this up. Logging Git commits with doing
Text-mode interface for git.
A more basic tool, vcprompt.
I plan on coding for many years.
I'm already in the shell.
Open source and availible on all systems.
Will NEVER die.
I love using the keyboard.
RSIA Git wrapper so awesome, it should be illegal.
Download and enable modules
Backup and import databases
Run updates
Watch logs
Log in as any user and much much more!
Drush commands against a specific Drupal site, even remote sites.
drush @youralias somecommand -y
drush use @youralias
drush somecommand -y
Tired of typing the full alias for every command
Now you can just type
drush ws --tail
The new CLI for Drupal. A tool to generate boilerplate code, interact with and debug Drupal.
Download, install, and run Drupal
Debug routes.
Build modules, themes, plugins and more.
Generate content.
Much more.
Debug routes.
Build modules, themes, plugins and more.
Generate content.
Much more.
Detach and attach to terminal sessions without loosing state.
Isolate your terminal sessions.
Script terminal session layout based on project needs.
Detach and attach to terminal sessions without loosing state.
Isolate your terminal sessions.
Script terminal session layout based on project needs.
Allows me to quickly switch between projects
Sessions
Windows
Panes
Create multiple session
Detatch and reattach
Switch sessions quickly
Widows are kind of like tabs.
Create, delete, rename and move them
Efficient Drupal Development with Tmux and Tmuxinator