Skip to content

Latest commit

 

History

History
232 lines (181 loc) · 3.63 KB

commandline.md

File metadata and controls

232 lines (181 loc) · 3.63 KB

whoami

  • Elle Yoko Suzuki
  • @ellesuzuki

The Command Line: Your New BFF?

Non-GUI? What??

no need to be scared

Do I haz to??

not boring at all

I heart the CLI!

commandline is fun

What are we learning?

  • Why?
  • When?
  • What?
  • How?

What are we learning? (Cont'd)

  • Basic Commands
  • Special Characters
  • Flags, Options
  • Power Tools
  • Directories, Files
  • Text Editing

What are we learning? (Cont'd)

  • Configuring Your Environment
  • Internet Utilities
  • System Health

Why?

Why should I be interested or care?

  • (Short) Story Time!

Advantages

  • Faster!
  • Can combine stuff!
  • Can automate!
  • Funner!

Disadvantages

  • A learning curve
  • May take a bit of getting used to
  • May not be as pretty as GUIs

When?

When do I use the command line?

  • Navigating around on a computer (ls, pwd,..)
  • Accessing a remote server (ssh); sending files back and forth (sftp)
  • Editing files (vi, pico)
  • Using version control (git)
  • Running scripts (Ruby, PHP..)
  • Reading log files

What?

What is this command line thing?

  • Command Line Interface (CLI)
  • WAY of interacting with a computer (program) via text
  • The text are the 'command lines'

How do I use this thing?

  • Via a 'shell'

What's a shell?

  • Implementation of a command line interface (CLI)

There are many shells

  • sh --Bourne shell (original)
  • csh --C shell (next original)

Derivative/Variant shells

  • bash --Bourne-again shell (Mac OS X default)
  • ksh --Korn shell
  • zsh --Z shell
  • tcsh --Tenex C shell

Accessing shells on different OSes

  • Mac OS X: Terminal
  • Windows: Cygwin
  • UNIX/Linux terminals

Commands as Tools

commands as tools

Example Tools

  • date
  • cal
  • bc

Some Basic Tools

  • pwd -- present working directory
  • ls -- list all the files!
  • cd -- change directory

More Basic Tools

  • cat --show me what's inside!
  • touch -- make an empty file
  • cp -- copy
  • rm -- remove
  • mv -- move

Basic Special Characters

  • . (a dot)
  • .. (2 dots!)
  • ~ (tilde)
    • (an asterisk, or 'star')

Questions?

questions

Command options/flags

  • Preface with a - (dash)

Command options/flags

  • ls -ltaF

Command options/flags

  • rm -rf
  • rm -i

Command options/flags

  • cp -pr

How to find options

  • man pages (manual)
  • man ls

Directories, Files

(image: http://ralev.com/)

Directories, Files

  • Absolute versus relative
  • Permissions

File Permissions

(image: http://elvissantana.com/home.html)

Who Can Access What?

  • chmod
  • chown
  • chgrp
  • umask

Shortcuts

  • clear
  • alias
  • ctrl+a/e/u
  • history; up/down arrows
  • tab completion

More Tools

power tool

More/Power Tools

  • more/less
  • head/tail
  • grep
  • wc
  • diff
  • find

Additional Symbols

  • ;
  • |
  • !
  • &
  • >
  • <
  • ^
  • $

Questions?

questions

Text Editing

  • pico
  • vi
  • emacs

Configuring Your Environment

  • Tweaking the ~/.bashrc
  • ~/.bash_login

Other Cool Stuff

  • tar
  • gzip, gunzip
  • screen
  • mail, pine
  • cron
  • awk, sed

Internet Utilities

  • ssh
  • sftp
  • scp
  • git

Writing Basic Scripts

Network/Local System Health

  • ping
  • ps
  • du
  • df
  • top

Resources

  • man pages
  • the Internet!
  • books

Books

  • UNIX and Linux 4th edition, Visual Quickstart Guide (Deborah Ray, Eric Ray)

Free At Last! (From GUIs)

yay

Questions ?

questions

Go Forth and Practice All the Things!

  • @ellesuzuki
  • Elle Yoko Suzuki