Getting a CLUE at the Command Line
-
Upload
emma-jane-hogbin -
Category
Technology
-
view
129 -
download
2
description
Transcript of Getting a CLUE at the Command Line
![Page 1: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/1.jpg)
drupal.org/user/1773 @emmajanehw
http://bit.ly/getting-a-clue
GETTING A CLUEAT THE COMMAND LINE
E M M A J A N E H O G B I N W E S T B Y
![Page 2: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/2.jpg)
1. Start by understanding how you’ll benefit.
2. Group functionality and map it to things you already know.
3. Play the pre-game to learn the moves.
4. It’ll be okay. Don’t panic.
![Page 3: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/3.jpg)
It’s because there are no pictures. You’ll need to learn to make your own.
tl;dltoo long; didn’t listen
![Page 4: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/4.jpg)
How People Think
http://rebloggy.com/post/spoilers-mine-sherlock-bbc-sherlock-sherlock-spoilers-his-last-vow-lars-mikkelse/73135846244
30% visual/spatial
45% visual + words
25% words
http://en.wikipedia.org/wiki/Visual_thinking
![Page 5: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/5.jpg)
http://www.mobygames.com/game/amiga/dune-ii-the-building-of-a-dynasty/screenshots/gameShotId,142587/
![Page 6: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/6.jpg)
$ _
![Page 8: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/8.jpg)
start by understanding how you’ll benefit
![Page 9: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/9.jpg)
goal: consistency
![Page 10: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/10.jpg)
copy-paste-able commands
so what?
![Page 11: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/11.jpg)
it’s easilyconverted to a script
so what?
![Page 12: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/12.jpg)
scripts can be automated
so what?
![Page 13: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/13.jpg)
automation means fewer mistakes
so what?
![Page 14: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/14.jpg)
group functionality and map it to things you
already know
![Page 15: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/15.jpg)
1. task runners 2. scaffolding 3. package managers
![Page 16: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/16.jpg)
task runnersTask runners are a set of tools to make build operations consistent, clean and well documented. They provide helpers to manage operations on the project file system via the command line.
![Page 18: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/18.jpg)
Examples of Task Runners• Front end: grunt, gulp, (npm), broccoli, brunch
• Linux: Make
![Page 19: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/19.jpg)
scaffoldingDesign time scaffolding produces files of code that can later be modified by the programmer to customize the way the application database is used.
![Page 21: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/21.jpg)
Examples ofScaffolding
• Tangibles: Lego kit
• Front end dev: Yeoman
• Drupal: base theme (with starter theme)
• Linux: Make
![Page 22: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/22.jpg)
ScaffoldingCommon Tasks
• create an empty shell site$ yo webapp
• create a new site$ compass create my_project
![Page 23: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/23.jpg)
package managersA package management system, also called package manager, is a collection of software tools to automate the process of installing, upgrading, configuring, and removing software packages for a computer's operating system in a consistent manner.
![Page 24: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/24.jpg)
![Page 25: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/25.jpg)
Examples ofPackage Managers
• OSX: Mac App Store, MacPorts, brew
• Linux: dpkg, RPM
• Front End Dev: npm, Bower, RubyGems
![Page 26: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/26.jpg)
Package ManagerCommon Tasks
• locate software $ brew search git
• install software $ brew install git
• check if updates are available$ brew update!
• install latest version$ brew upgrade git
![Page 27: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/27.jpg)
Create Your Mental PalaceSport Package
Manager Scaffolding Task Runner
Generic download, install environment
create new instance automate tasks
Tennis builds a tennis stadium
Sets up the tennis net
Retrieves the ball during the
game.
Front end dev bower yeoman grunt
???
![Page 28: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/28.jpg)
play the pre-game to learn the moves
![Page 29: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/29.jpg)
Good command line utilities make you feel smart.
• The help sub-command includes a functional, not alphabetical, grouping of tasks.
• Always gives an output to the screen after running.
• Provides tips on customisation, and “next steps”.
![Page 30: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/30.jpg)
Tips for Navigating• To navigate past commands, use the arrow keys.
• To list past commands, type: history.
• To repeat a previous command, use !history#
• To search for past commands, use CTRL-r.
![Page 31: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/31.jpg)
Tips for Typing Commands• Auto-complete what you’re typing with the tab key.
• To delete a word in your command, use CTRL-w.
• To jump to the beginning of the line, use CTRL-a.
• To jump to the end of the line, use CTRL-e.
![Page 32: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/32.jpg)
Pro Tip
remap your caps lock key on OSX
![Page 33: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/33.jpg)
Finding the Command Line
![Page 34: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/34.jpg)
Command Line Interface
http://en.wikipedia.org/wiki/Command_Prompt
![Page 35: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/35.jpg)
![Page 36: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/36.jpg)
$ _
![Page 37: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/37.jpg)
Determining Input
![Page 38: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/38.jpg)
define:prompt• a transitive verb meaning To move to action.
? forward 90
> open mailbox
![Page 39: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/39.jpg)
define:commandverb!
• give an authoritative or peremptory order. "a gruff voice commanded us to enter”
noun!
1. an authoritative order. "he obeyed her commands without question"
2. the ability to use or control something.
![Page 40: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/40.jpg)
CommandsOne-word actions:
• sing
• jump
• look
One-word commands:
• help
• exit
• history
![Page 41: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/41.jpg)
Commands with ParametersAn action, and a direct object:!
• take book
• read pamphlet
• open window
Commands with parameters:!
• cd /var/www
• man <command_name>
• mv current_name.jpg new_name.jpg
![Page 42: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/42.jpg)
Commands with Parameters and Modifiers
Refining the request:!
• go down stairs
• take blue pill
• open left door
Adding a flag/switch/modifier:!
• mkdir -p directory/sub-directory
• tar xvf file_to_extract.tar.gz
• ls -lh
![Page 43: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/43.jpg)
Ten Commands
![Page 44: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/44.jpg)
“all” commands
http://www.commandlinefu.com/commands/browse This site includes a “rating” function.
![Page 45: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/45.jpg)
It’ll be okay.Don’t panic.
![Page 46: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/46.jpg)
read outputs in both directions.
![Page 47: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/47.jpg)
the reptile brain
![Page 48: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/48.jpg)
The type of output can change depending on the commands you’re running.Read outputs in both directions.!
• Information from the program you just ran: read top to bottom
• Printed summary of actions taken: read bottom to top
![Page 50: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/50.jpg)
1. Start by understanding how you’ll benefit.
2. Group functionality and map it to things you already know.
3. Play the pre-game to learn the moves.
4. It’ll be okay. Don’t panic.
![Page 51: Getting a CLUE at the Command Line](https://reader034.fdocuments.net/reader034/viewer/2022051513/547e8d59b4795993508b4b9d/html5/thumbnails/51.jpg)
WHAT DID YOU THINK?E V A U L A T E T H I S S E S S I O N - W R I T T E N F E E D B A C K F O R M S
FOR MORE INFORMATIONdrupal.org/user/1773
@emmajanehw http://bit.ly/getting-a-clue