Содержание
Table of Contents
Bash
Introducing UNIX
00:00:00 - 00:07:02
Introducing UNIX
James Halliday introduces Bash by placing its context with the history and background of Unix, an operating system first developed at AT&T Bell Labs in the 1960s. -
https://github.com/substack/fmmn/blob/master/day1/unix.md -
https://www.youtube.com/watch?v=tc4ROCJYbm0 -
https://en.wikipedia.org/wiki/File:Unix_history-simple.svgIntroducing the Unix Shell
00:07:03 - 00:16:00
Introducing the Unix Shell
James presents the Unix shell, a computer program that executes other computer programs, and its importance with the UNIX philosophy.
Using Shell
00:16:01 - 00:20:24
Using Shell
After prompting students to open a terminal window and figuring out which shell they have installed on their computers, James demonstrates how to navigate through folders and files in an operating system through the terminal.
Introducting Aliases
00:20:25 - 00:23:36
Introducting Aliases
While students work on changing directories, James spends some moments demonstrating and writing temporary aliases. An alias is a stand-in or replacement of a word by another string mainly used for abbreviating a system command.
Special Directories
00:23:37 - 00:26:51
Special Directories
James demonstrates special directories within the Bash shell that make it easier to navigate folders.
File Management
Combining and Copying Files
00:26:52 - 00:34:09
Combining and Copying Files
James introduces to commands for files: The cat command, which concatenates many files into one file, and cp command, which can copy a file to another directory or file name.
Moving Files and Creating Directories
00:34:10 - 00:38:59
Moving Files and Creating Directories
To move files, James introduces the mv command. Afterward, James shows how to create a director with mkdir command and how to use tab to auto-complete directories.
Commands to Help Reduce Repetitive Typing
00:39:00 - 00:47:10
Commands to Help Reduce Repetitive Typing
After showing the wildcard character to matching files, James demonstrates how to use brace expansions, which allow for expanding patterns that would be repetitive to type out by hand.
Deleting Files and Counting Words
00:47:11 - 00:52:28
Deleting Files and Counting Words
James introduces the rm command file to remove files and directories. Then James shows how to use the wc command to count the number of lines, words, and bytes in a file.
Documentation and Options
00:52:29 - 00:55:35
Documentation and Options
To find the documentation at any time, James shows the man command that lists the commands that are available in the shell. Afterward, he demonstrates that options also called flags or switches, which are special arguments that can be passed onto shell command.
Paths
00:55:36 - 00:57:34
Paths
James demonstrates how to navigate to a file with absolute and relative paths.
Writing and Reading Files
00:57:35 - 01:04:30
Writing and Reading Files
James introduces file redirects. Redirects can write the output of a command to a file, overwrite a file with new contents if it already exists.
Pipes
Pipes
01:04:31 - 01:08:15
Pipes
James shows the pipe operator, which can feed the output of one program to the input of the next.
Curl, Grep, and Pipeline
01:08:16 - 01:16:39
Curl, Grep, and Pipeline
James demonstrates the curl command, which grabs data from or to a server using many protocols like HTTP or FTP. Using the curl command to grab a public domain text, James then shows how to chains commands until he figures out the number of types the word "whale" is used in Moby Dick.
head and tail commands
01:16:40 - 01:18:40
head and tail commands
James reviews the head and tail commands. Head command prints the first part of a file while the tail command reads from the end of the file.
Calendar and Dates
01:18:41 - 01:23:23
Calendar and Dates
James shows how to print out the date with date command as well as showing the month or year with the cal command.
Shorten Lines
01:23:24 - 01:24:41
Shorten Lines
James demonstrates the fold command, which is used to shorten long lines.
More Curl and Grep
01:24:42 - 01:27:46
More Curl and Grep
James reviews in more detail curl and grep.
Backticks and Arithmetic
01:27:47 - 01:33:25
Backticks and Arithmetic
James shows how to use backticks, which allow the output of a program in the arguments list of another. Then James illustrates how to do simple arithmetic at the command line.
Q&A: Watch and Weather
01:33:26 - 01:39:50
Q&A: Watch and Weather
James takes questions from students about the watch and the calendar commands.
Environment Variables
01:39:51 - 01:49:06
Environment Variables
James introduces environment variables, what are variables defined by the shell and shell scripts.
Quotes
01:49:07 - 01:53:01
Quotes
To escape special characters from an argument, James introduces the use of quotes.
Bash Shell Scripts
Introducing Scripts
01:53:02 - 01:59:37
Introducing Scripts
To keep from writing the same sequence of commands repeatedly, James shows how to write and store a script that can be executed.
Read, Loops and While
01:59:38 - 02:08:24
Read, Loops and While
James demonstrates the read command, which takes input from the keyboard and assigns it to a variable. After that, James covers loops that run a set of commands repeatedly. Then James expands upon the loop to show the while loop, execute a set of commands repeatedly until some condition occurs.
$PATH
02:08:25 - 02:13:12
$PATH
James introduces the special environment variable $PATH
Permissions
02:13:13 - 02:20:51
Permissions
James explains that files on a UNIX system belong to a user or a group. Each group can have granular permission to write, edit, or view a file. Those permissions can be changed using the chmod command.
Exit Codes, Operators, and Subshells
02:20:52 - 02:31:37
Exit Codes, Operators, and Subshells
James illustrates an exit code, which is a code returned to a parent process by an executable. If the code is successful, the exit code is 0. Next James demonstrates the &&, ||, and ; operators. Then James demonstrates a subshell, which is a subprocess or child process of the parent shell.
Job Control
02:31:38 - 02:44:07
Job Control
James examples job control as a method Bash handling multiple programs running in parallel. James takes questions from students.
Screen
02:44:08 - 02:51:32
Screen
James introduces screen, which allows multiple virtual windows in Unix.
Regular Expressions
Introducing Regular Expressions
02:51:33 - 02:57:25
Introducing Regular Expressions
James introduces Regular Expressions (regex or regexp), which is special text string for describing a search pattern or a search and replace command. -
https://github.com/substack/fmmn/blob/master/day1/regex.mdRegular Expressions in JavaScript
02:57:26 - 02:58:59
Regular Expressions in JavaScript
James demonstrates how to use Regular Expressions in JavaScript.
Flags, Metacharacters, and Quantifiers
02:59:00 - 03:08:32
Flags, Metacharacters, and Quantifiers
James shows how to gain finer control over searches with Regular Expressions through the use of flags, metacharacters, and quantifiers.
Character Class Ranges
03:08:33 - 03:24:53
Character Class Ranges
James introduces characters classes, which commands Regular Expressions to match several sets of characters
Anchors, Groups, and sed
03:24:54 - 03:35:50
Anchors, Groups, and sed
To have a search pattern check at the start of the beginning of a string, James shows anchoring within Regular Expressions. Then James demonstrates capture groups, which allow for targeting a number of letters or numbers. Next James introduces sed, a stream editor used to perform basic text transformations.
QA: Regular Expressions Reference
03:35:51 - 03:45:17
QA: Regular Expressions Reference
James shows the Perl Regular Expressions Reference as a useful tool that is probably already installed on your OS for researching syntaxes for Regular Expression. James takes questions from students. -
http://perldoc.perl.org/perlreref.htmlWrapping Up Regular Expressions
03:45:18 - 03:46:20
Wrapping Up Regular Expressions
James wraps up Regular Expressions with some advice on how to keep on learning.
Vim
Introducing Vim
03:46:21 - 04:00:30
Introducing Vim
James introduces Vim, an interactive text editor program for Unix that is popular for its rich features and as a development environment. The Vim editor supports ANSI codes that are special instructions that your terminal interprets and renders like moving the cursor around, change colors, or set editing modes. - -
https://github.com/substack/fmmn/blob/master/day1/vim.md -
http://www.fprintf.net/vimCheatSheet.html -
http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/Using Vim
04:00:31 - 04:05:25
Using Vim
James shows how to use Vim to open, edit, and quit files.
Modes and Moving Around
04:05:26 - 04:09:20
Modes and Moving Around
James demonstrates how to move within a document while editing within the Vim editor.
Deleting and Searching
04:09:21 - 04:18:16
Deleting and Searching
After showing how to delete files, James demonstrates how to search within in a document with Regular Expressions. James takes questions from students.
Search and Replace
04:18:17 - 04:21:12
Search and Replace
James demonstrates search and replace with Regular Expressions.
Visual Select
04:21:13 - 04:25:03
Visual Select
James introduces visual mode, which is a flexible and easy mode to select a piece of text for an operator.
Paste Buffer and Insert Modes
04:25:04 - 04:29:14
Paste Buffer and Insert Modes
Within visual mode, James introduces the paste buffer, which allows for copy and pasting. Then James introduces insert modes for finer control over the opening of files.
Wrapping up Vim
04:29:15 - 04:33:21
Wrapping up Vim
While wrapping up the course, James shows some tricks with Vim including inserting a file into another file; pipe commands within the editor; and remap characters for better editing experience.