Command Line Tips (Lightning Talk)

3 posts / 0 new
Last post
#1 Wed, 2017-04-26 11:02
Offline
Joined: 2 years 3 months ago

Command Line Tips (Lightning Talk)


Command Line Tips

A quick introduction to command line features.

Keys

  • c = ctrl
  • m = meta (a.k.a., alt)

Ctrl is for small movements. Alt is for larger movements.

Movement

  • c-a -- go to beginning of the line
  • c-e -- go to end of line

Movement

Movement by letter:

  • c-f -- move forward by one letter
  • c-b -- move backward by one letter

Movement by word:

  • m-f -- move forward by one word
  • m-b -- move backward by one word

Deletion

  • c-d -- delete one letter
  • m-d -- delete one word
  • c-k -- "kill" the text from the current position to the end of the line
  • c-u -- delete text before the cursor.

Cutting & Pasting

  • c-space -- mark region
  • c-w -- cut
  • c-y -- paste

Bonus: c-x u (undo)

Help

  • man ls
  • man cut

Vim keybindings work on man pages. So type / to search or c-f or c-b to scroll, etc.

Commands

  • c-r -- reverse search for previously typed commands
  • | (e.g., uniq, sort, python -mjson.tool)
  • >, >> -- send output to a file
  • echo -- print to screen
  • cat -- send output of a file to screen and/or concat files
  • head, tail -- print the beginning or end of file
  • tree -- show directory structure
  • wc -l -- counts the lines (or other information) in a file
  • dirs, pushd, popd -- directory naviation
  • curl and wget -- fetch stuff from the Internet
  • mkdir -p (e.g., mkdir -p static/main.{js,css})
  • touch -- create files
  • top -- show system information
  • See the Command Line Study Guide for a long list of commands to know.

Example

csv2sqlite
There are many useful utilities available for download.

Tools

Study Groups

Current Study Groups:

Next Study Groups? (leave a comment below or send me a message if interested)

Wed, 2017-04-26 11:39
Offline
Joined: 2 years 3 months ago

Wed, 2017-04-26 13:43
Offline
Joined: 2 years 3 months ago

Also recommended at the meetup: Data Science from Scratch.