## Agenda 1. What is *nix? 2. What is Bash? 3. Moving around 4. Viewing files 5. Managing files 6. Editing files 7. Searching files 9. But how do I... 10. Write your own scripts! 11. Pipe and Filter 12. Resources
## What is *nix? >A Unix-like (sometimes referred to as UN\*X or \*nix) operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification. > > [Unix-like (Wikipedia)](https://en.wikipedia.org/wiki/Unix-like) Note: Any OS that is similar to Unix: Linux, FreeBSD, Solaris, OS X
## Moving around In addition to those commands you also have the following handy built-in shell capabilities: * Tab completion * Shell expansion ('~' and '*') * Clicky-clicky * history * alias Note: * Show tab completion * '~' = home directory, cd ~ * '*' = match anything, ls receip* * Selection with copy to clipboard, so left double click selects and copies, middle click will paste * history command and how to access it via the up arrow and the '!' character * alias (known under another name), via 'alias ..="cd .."'
## Viewing files * cat * more * less * tail and it's super useful -f argument Note: * cat, concatenate file onto standard out * more, file perusal filter * less, opposite of more .. LESS IS MORE! * tail, output the last part of a file
## Managing files * touch * cp * mv * rm * mkdir (-p) * rmdir (rm -rf) Note: * touch, update timestamp and create * cp, copy * mv, move * rm, remove files, can delete multi files at once. * mkdir, -p = make parent directory as needed * rmdir, not used much because of rm -r(recursive)f(force)
## Editing files * nano * emacs * vi Note: * These are your available editors. * I will not go into these, but one is obviously better than the others. * nano is very simple!
## Searching files * find * grep Note: * find --type f --name bob * grep -r(recursive) regex [files]
## Pipe and Filter An architectural pattern that is found everywhere: * Windows * Linux * OS X
## Definition > A filter is a program that takes a stream of text characters as its input and produces a stream of characters as its output. > > A pipe is a way of connecting two filters, in which the character stream output from the first filter is routed to the character stream input of the second filter. > > [Software Architecture](http://www.amazon.com/Software-Architecture-Foundations-Theory-Practice/dp/0470167742)
### Welcome to *nix where your dreams really can come true!
## Resources [Learn UNIX in 10 minutes](http://freeengineer.org/learnUNIXin10minutes.html) [Bash Guide for Beginners](http://www.tldp.org/LDP/Bash-Beginners-Guide/html/) Note: