Screencast Shell Productivity - Part 1 Electives

  • jaymcgavren
  • 9816 views
Badge-student

Locked Content

A subscription is required for viewing this video. Enroll now to get full access to all Code School courses and content.

Enroll Now Sign in

Comments

  1. Justin Herrick said

    Great Tips to be found here. Extremely useful. Thanks for working on this Jay

  2. Aditya Sanghi said

    I might be the only one here, but i don't like the amount of time that is spent on "table of contents" type of slides and explaining what we are going to talk about next. it's a screencast and i'd rather they get to the meaty bits quickly.

  3. devosvictor said

    This is cool ^^ Cant there be a course of this? It would be very helpfull as their arent alot good "how to work in shell" guides on the internet.

    Good work!

  4. Faculty

    Jay McGavren said

    @asanghi Standard public speaking advice is to "tell them what you're going to tell them", so I do it to help people track the flow of the screencast. Anything can be taken too far, though - I'll look for opportunities to shorten those summaries in the future.

  5. Faculty

    Jay McGavren said

    Everyone: thanks for the feedback! @devosvictor Dunno about a course, but I've got additional Code TV episodes planned on this topic...

  6. Alex Blakemore said

    Take a look at the xargs command. Its much more useful and easier to use than the -exec flag to find. And can handle more complex situations easily. Compare find . -name .svn -print | xargs rm -fr to find . -name .svn -exec rm -fr {} \;

  7. Yury said

    Nice stuff, Jay. Especially thanks for the ack and ruby tweaks. By the way find myproject -exec grep class {} \; can be replaced with more convenient grep -r class myproject

  8. Faculty

    Jay McGavren said

    Yeah, xargs is good stuff, huh? I find it combines nicely with that "cb" utility I showed, too. I'll make a point of covering it in a future episode, and you're right - it might make find -exec obsolete. I didn't even know about grep -r. Guess this is going to be one of those endeavors where I learn as much as I teach. :)

  9. Fabricio Matías Quagliariello said

    Dear sir: You have taught me plenty today and for that I thank you!

  10. seth said

    While this video is great, I have to agree that a course would be awesome.

    I'd think a course about choosing search commands and building basic regular expressions would be awesome, and I think you're the perfect one to do it.

  11. Eric Raio said

    This was awesome, how to see more screencasts like these. Thanks Jay.

  12. Javier Murillo said

    The Shell is the best friend of a developer. This video it's very cool. Regards from Mexico

  13. Elad Kehat said

    My productivity just went up a notch. Thanks!

    Regarding the cb utility, it uses pbcopy which is only available on osx. On linux I use xsel and alias clip to xsel --clipboard. It has the same effect as your cb.

  14. Anton Yakimov said

    Try to use Gow instead od Cygwin in Windows. And "Console" - nice terminl for same OS.

  15. Faculty

    Jay McGavren said

    I'm prepping the sequel for release in a couple weeks, and I want to avoid covering things everyone already knows about...

    Here's what I was thinking of covering: diff --recursive; xargs; sort -n; Including date, hostname, etc. in $PS1 prompt; history, including $HISTFILESIZE, !!, !1234, and reverse-search; Sharing a ~/dotfiles repo on GitHub.

    Thoughts?

  16. Scott Parrish said

    less has some useful conditionals for it's prompt too. the general format is: ?X:. for instance ?f%f:stdin. uses the ?f condition (Is there an input filename), displays %f if true and stdin if false. So a slightly fancier version of this same prompt would be: export LESS='-i-P?f%f:stdin. ?m(%i/%m). Line %lb?L/%L(%Pb\%).'

    for command: less file1 the prompt is file1 Line 47/174(27%)

    for command: less file1 file2 file3 file1 (1/3) Line 17/77(22%)

    for command: cat file1 | less stdin Line 47

  17. Marshall Shen said

    Great lesson! One suggestion: it might be very useful if we have a pdf of all the commands in the screencast with comments beside them, so that people can review the lesson easily.

  18. Peter said

    Some great tips here. Although, I'd like to see him step off his pedestal while screen casting. Think all IDEs are bloated? Think subversion is archaic? Telling me your unsolicited flame-war opinions makes you sound like a snob, and more importantly, it detracts the viewer from your message.

  19. Faculty

    Jay McGavren said

    @audioman apologies if I've offended. I really do think many IDEs have unnecessary bloat, but Subversion has helped me out a lot over the years and my comments there were meant to be tongue-in-cheek. Regardless, this is indeed not the forum for religious wars over tools, and people should use what helps them get their jobs done. My goal is to present the tools that help me do mine.

  20. Jeremy McDuffie said

    Great screencast. As for removing with the find command, why not just use the -delete flag? For example:

    find -name '.DS_Store' -type f -delete

  21. Terry Pensel said

    I love this screencast Jay. I find it really helpful for anyone who has to edit/manage/create files which is EVERYONE. The SSH command line history, and record what they have done for problem tickets is especially helpful. We need more on how to do command line editing on previous commands in the bash shell. Jay, Mahalo for making this screencast.

  22. Matthew Closson said

    Jay, nice tips on the find -exec. Now I use this to update multiple .acignore files in this version control system called accurev which requires one .acignore file per subdirectory.

    find . -type d -mindepth 1 -exec cp .acignore "{}" \; then I alias that in my ~/.bashrc to acigup. Very nice.

  23. Julio Gonzales Heredia said

    The information provided is excellent, but the video freezes at 10:55 and only audio continues.

  24. Faculty

    Jay McGavren said

    @julioagh I wasn't able to replicate this, but if the problem continues, file a ticket at http://help.codeschool.com/ and we'll get it looked at. Please be sure to note whether the problem is with the embedded video, or the HD or SD download.

  25. Onezino Gabriel Moreira said

    Jaym, you gave us great tips. Can I request a "be productive in vim" screencast?

  26. Ryan Dennler said

    Very great tutorial, I learned alot from this.

  27. Thomas James Repetti said

    great video! especially the really interesting features of the find exec command. The last segment was kind of lost on me. after signing up for the service, i was a little surprised to see the lack of non-web-development languages and the dominance of ruby. i know these are what envy labs specializes in, but i feel like for writing coreutil-esqe programs, it should be done in bash or lower.

  28. Faculty

    Jay McGavren said

    Someone requested a list of the commands used over on Part 2... Here's a gist with the outlines for both parts, including commands: https://gist.github.com/3965735

  29. Pedro Assumpção said

    Nice tips for find command. Tks.

  30. aplyca said

    Great tips. Here is a nice resource with Bash shortcuts that everyone should know.

    http://beerpla.net/2008/12/22/mastering-the-linux-shell-bash-shortcuts-explained/

    Felipe

  31. Luis Albarenga said

    Great Tips, very useful

  32. Dominick Guzzo said

    very well presented and with some pretty nifty tricks in there. thanks for sharing!

  33. halolee said

    Hi Jay,

    Great screen cast, please ignore my comment in the Unix Part 2, I found exactly what I want here.

    Totally awesome :D

About This Screencast

In this episode, Jay McGavren shares some of his favorite tricks for working in the shell. No unreadable sed or awk scripts here. Just simple, solid tips you can use every day, including time savers with find, less, ssh, and command-line Ruby.

You need to be an enrolled student in order to view this video and subscribe.

Enroll Now