======UNIX/Linux Fundamentals Course Notes====== For help with wiki syntax: * [[http://lab46.corning-cc.edu/wiki/syntax|Wiki Syntax]] * [[https://www.dokuwiki.org/_media/plugin:wrap_plugin_example6.png|Wrap Plugin Syntax]] **__Class Notes__** **Important Idea** There are two modes of operation that can be observed when using a text editor:\\ - Issuing a command\\ - Inserting text\\ __Insert Commands__\\ i: enter insert mode before cursor\\ a (append): enterinsert mode after cursor\\ I: enter insert mode at the beginning of the line that the cursor is currently on\\ A: enter insert mode at the end of the current line\\ o: append a new line below the current line\\ O: append a new line above the current line\\ __Navigation Commands__\\ //"Arrow Keys"// - Cursor Movement (navigation by character)\\ k: up, l: right, j: down, h: left\\ Note: Adding a number before any of the commands allows movement by that many characters:\\ Ex.) 8h\\ w: navigates forward by word\\ W: navigates forward by space\\ b: navigates backwards by word\\ B: navigates backwards by space\\ G, gg: go to line (with a number placed in front of the command)\\ __Manipulation Commands__\\ x: delete (cutting)\\ xxx: delete "3"\\ X: akin to a backspace\\ dw,dW: see above syntax for w,W (deletes by...)\\ db, dB: see above syntax for b,B (deletes by...)\\ dd: deletes the current line\\ d^: deletes backwards from cursor\\ d$: deletes forwards from cursor\\ .: repeats the last used manipulation command\\ { , }: movement backwards/forwards by paragraph\\ (Shift)~: toggles case of letter that the cursor is on (if held then will proceed through rest of document)\\ /: Allows for the user to search the document\\ n, N (while in a search): Moves the cursor to the next and previous result respectively\\ r: redo\\ u: undo\\ p: paste below cursor\\ P: paste above cursor\\ cc: cut into insert mode\\ cw, cW: see above syntax for w,W (cuts by...)\\ cb, cB: see above syntax for b,B (cuts by...)\\ yy: paste into insert mode\\ yw, yW: see above syntax for w,W (paste by...)\\ yb, yB: see above syntax for b,B (paste by...)\\ y{, y}: see above syntax for {,} (paste by...)\\ __Extended VI Commands__\\ To enter press colon while in command mode(:)\\ :w :save\\ :w! :force save\\ :wq :save and exit\\ :q :quit\\ :q! :force quit\\ :co0 :copy to current line (line #, example 0)\\ :%s/(pattern 1)/(pattern 2)g :replaces any example of (pattern 1) with (pattern 2)\\ __Customization Commands__\\ All examples of the number sign represent any number to apply\\ :set tabstop= #\\ :set shiftwidth=#\\ :set number :toggles side numbering in VI\\ :syntax on\\ :set cursorline\\ :set cursorcolumn\\ :colorscheme (example) :Turns the default color scheme to another (press tab after command to see choices)\\ (Created 9/16/2017) - Robin Lash\\ **__Advanced Scripting__**\\ (Basic scripting can be found in the example scripts created for reference in class)\\ **Vertical Operators**\\ - Unary: if exists (performs one operation)\\ - Binary: if "name"/"number" is greater than ..... (two operations)\\ __Operators__\\ - eq: is equal to\\ - ne: is not equal to\\ - le: is less than or equal to\\ - lt: is less than\\ - gt: is greater than\\ - gr: is greater than or equal to\\ - !: invert logic\\ &&: and and\\ "||": or or\\ (Edited 9/23/17 Robin Lash) __Example HTML__\\ (for wpa0)\\ - Tells the type of document\\ \\
- Start of the page\\\\
- Bold the words\\
\\
u\\
- Create a space in the document\\