The original article is merely a fragment; the following is a work in progress – to be integrated into the former when complete. I’m still learning to do things properly, which is to say deeply/fully/completely – not superficially/minimally-acceptably/lazily. I’ve begun to go through, review and summarise stuff from the lessons/homework that I’d forgotten/not fully grokked so far. I left this til too late and tired, which doesn’t result in quality work. I need to think more about what does lead to quality; so far, not rushing/leaving to last minute; writing from my perspective (ie. primarily how things are interesting/useful to me) come to mind.
Session 1 – First Steps
- The command line interface ditches the GUI in favour of textual input
- Commands follow the syntax
- <command>[SPACE]<options>[SPACE]<parameters>ENTER
- parameters are usually filenames; can include the path to a file/wildcards
- Path separator: /
- / by itself means the root directory; denotes absolute filepaths. All other filepaths are relative (starting from the working directory)
- man -k [keyword] can be used to search for manual pages containing the keyword
- use the -i option to avoid mistakes with cp, mv, rm etc.
- Vim commands
- :q! – exit without(!) saving
- :wq – exit with saving
- x – delete highlighted character
- i – enter insert mode
- A – append text (to end of line)
- dw – delete word
- d$ – delete to end of line
- dd – delete entire line
- 0 – move to start of line
- $ – move to end of line
- u – undo
- U – undo all changes on line
- CTRL-R – redo
Session 2 – Virtues of Text
- Plain text refers to a sequence of characters (usually one per byte), conforming to various conventions
- Character encoding: ASCII
- Encoding is the mapping of numbers to symbolic value – usually a 7-bit code (=128 characters); 8th bit used for parity
- Unicode is another standard; keeps inflating with more characters
- Plain text is simple; allows manipulation with standard tools, eg. reading (cat/less), writing (vim), comparing (diff), searching (grep) etc. WYSIWYG
- Binary blobs are complex; require proprietary software/tools. Hidden content/opaque
- Metacharacters
- * – inclusive wildcard; matches any group of characters of any length
- ? – matches any single character
- [..] – matches a set/range of characters, eg. [a-c]* for all files starting a or b or c; [ab]* for all files starting a or b
- ; – separates sequence of commands on same line
- Shell is command interpreter; receives commands as inputs and searches for the specified program to run