Your SlideShare is downloading. ×
0
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Intro to the command line
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Intro to the command line

453

Published on

Presented to attendees of RailsGirls Sydney Nov 2013. …

Presented to attendees of RailsGirls Sydney Nov 2013.

The command line. Developers' attitudes and common usage. How to improve your experience with it, from a beginner's perspective.

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
453
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. The Command Line Your next best friend that you kinda still hate
  • 2. What is it? • Windows: cmd.exe
 
 C:Usersmyusername>
 • OSX/Linux: Terminal
 
 
 
 computername:~ username $

  • 3. What is it?
  • 4. What do programmers use it for? In order of most frequent to least frequent: git git git git git git git git git git git status
 grep
 diff
 add
 log
 checkout
 commit
 push
 pull
 show
 rebase
  • 5. What else? rails rails rails rails new myapp
 g model Blog title:string
 console
 db

  • 6. What else? rake routes
 rake db:setup
 rake db:migrate

  • 7. Much Less Frequently brew install rename # Mac
 gem install rails
 gem list -d
 gem list -r
 bundle
 rvm use 1.9
 rvm use 2.0

  • 8. Why should I care? One year from now you can automate your whole job... git log $(git merge-base master branch)..branch cut -f1,2 -d’ ’ ~/.bash_history | sort | uniq -c | sort -nr | head -n 30 wget -mk http://www.stuff.to/read/on/the/train/ rsync -rvP myproject/ username@myhost/myproject.com/ pg_dump --clean -Z 9 app_master | ssh user@apphost ‘zcat | psql -h localhost -U app appdb’
  • 9. Don’t Panic
  • 10. Basics cd projects/railsgirls/ cd .. pwd ls -l # # # # change into a directory
 get out of a directory
 print current directory 
 list the files here ! • • Pay attention to the “current directory” • Press tab to complete filenames Press the up and down arrows to run previous commands
  • 11. Get Unstuck man wget
 (spacebar for next page, q to quit) rails --help Most reliable: Google “wget command”
  • 12. Stay Focused As a Rails developer, there are only a handful of commands you’ll use regularly. git
 rspec
 rake
 rails
 gem
 bundle
 irb
 ruby
 subl / vim
 open
 sudo
 ssh

  • 13. Next Steps Incrementally improve your
 command line capability
  • 14. git config --global color.ui true
  • 15. echo "alias ls='ls -ohG'" >> ~/.bash_profile
  • 16. Shortcuts up, down, tab up, down, tab up, down, tab up, down, tab up, down, tab
  • 17. Ctrl-A Ctrl-E Alt-Delete 
 start of the line
 end of the line
 delete previous word
 
 Works virtually anywhere! * ** * Terminal, Chrome, Sublime, Evernote, Keynote, XCode, LibreOffice, System Preferences, Gnome, KDE, XFCE4…
 ** Windows? Not sure.
  • 18. More Shortcuts Ctrl-C Ctrl-R Alt-B Alt-F Alt-D stop current command (e.g. rails server)
 search for a previous command
 go back one word
 go forwards one word
 delete next word
  • 19. Ctrl-R 1. Ctrl-R 2. Start typing (e.g. type “rebas”) 3. Ctrl-R to jump to next oldest match 4. Ctrl-S to jump to next newest match 5. Return to run, Esc to cancel
  • 20. Configure Terminal
  • 21. Configure iTerm2
  • 22. Text
  • 23. There Must Be a Better Way! There usually is
  • 24. @gregmcintyre microcourses.info

×