Table of Contents

Corning Community College

CSCS1730 UNIX/Linux Fundamentals

Course Wiki Page

Projects

Pct0 Letter Division. This project takes elite level concentration and basic knowledge of long division. If you need to review long division this link helps quite a bit: (http://www.mathdoesntsuck.com/downloadable/longdivisionreview.pdf) This project is probably the most frustrating of all.

Here are some tips to help cope:

URLs

Helpful for webpage project. https://www.simplehtmlguide.com/cheatsheet.php

Some good information about the Printf command: https://wiki-dev.bash-hackers.org/commands/builtin/printf

Here is a search engine that respects your privacy https://duckduckgo.com/

Notes

Commands

How to claim participation points
-from lab46 prompt type: 'wcp unix wcp1' (putting the proper week number at the end instead of the 1)

Commands for your repository
(make sure you are in your repository directory)

-'hg status' (shows files and whether or not they are tracked)
-'hg add' (begins tracking all untracked files, put a filename at the end to just do one)
-'hg commit -m “description here”' (tracks changes with a comment)
-'hg push' (updates repository with commits)

Commands That we Have Learned:
(Note: commands are used as written so if capitalized it needs to be capitalized and if a “ ” is used you need to put what is in there.)

Control (Ctrl or ^) Commands:

VI
(the greatest text editor known to man…)
(apparently)

-'vi (filename)' starts editing
-'vi (line number) (filename)' this will open the file on that line

Vi is a moded editing system, invented before the mouse and when keyboards had less keys.

Modes

Command mode
- This is the starting mode
- All other modes are accessed from here
- Escape usually brings you here
- Nearly every key stands for a command
- (see below for commands)

Insert mode
Typing of text happens in this mode
These are some ways to start insert mode from command mode:
-'i' starts insert mode (starts before the current cursor position)
-'I' starts insert mode (starts the cursor at the beginning of the line)
-'a' starts insert mode (starts after where the cursor is)
-'A' starts insert mode (starts the cursor at the end of a line)
-'o' starts insert mode (starts by creating a new line under the cursor line)
-'O' starts insert mode (starts by creating a new line above the cursor line)

Other Commands
-'v' for visual mode (for selecting large portions visually)
-'/' starts a search (like a man page)
-'h' moves cursor left
-'j' moves down
-'k' moves up
-'l' move right
-'w' moves right one word (w counts . : and the like, but W only spaces) [e does the same but to the end of the word]
-'b' moves back a word (b, B like w and W)
-'{' and '}' navigates by paragraph
-'(number)G' goes to that line number
-'~' toggles the case where the cursor is

-'yy' yank line (copy, there are multiple buffers use ”(letter) to select)
-'dd' cut line
-'cc' change line
-'p' is paste (P like o and w)
-'x' deletes by character
'y', 'c' and 'd' can be used to do by any amount (word line etc)
i.e. #yl yanks # of characters to the right
-'.' repeats the last command
-':wq' saves and exits
-':q!' exits without saving

You can prefix many of these commands (i.e. with numbers for repitition)

Regular Expressions

Basic Regular Expresions (regex)

$ end of line
\? match 0 or 1 of the previous
. match any single symbol
* match 0 or more of the previous
[] match any one of the enclosed
[^ ] do not match any one of the enclosed
\< match start of word
\> match end of word

Tools that use these include:
vim, grep, sed, awk

Extended regex

+ one or more of the previous
() goup
\( \) regex group

tools that use these include:
vim, egrep, sed, awk

EXTRA

https://til.hashrocket.com/posts/2fdb6afb66-difference-between-wq-and-x

Difference Between :wq and :x

The :wq command is used in Vim to write and quit. The contents of the buffer are written to disk for the associated file and then the Vim session is terminated. So, what is the difference between this and the :x command. The Vim help files give the following description of the :x command:

  Like “:wq”, but write only when changes have been made.

So, :wq writes the buffer to disk either way, whereas :x just exits if the buffer hasn’t changed. Either way the contents of the resulting file are going to be the same. So what’s the difference?

Modification time.

If you :x a buffer that hasn’t changed, the modification time will be untouched because the file isn’t re-saved. The :wq command will alter the modification time no matter what.

This matters if the modification time is used by anything. For instance, a background process that monitors a directory for changed files based on modification times will get some false positives if you use :wq too liberally.

HTML Tips and Tricks

If in html and trying to make a webpage then use f12 or pages already made and you can see code already done. This can give examples very quickly of what you can do in an html page or how to do something in an html page.

Login Problems

Some people have reported problems logging into the wiki. There seems to be a few sources of problems experienced:

If you are confident you are using the correct username and password, and are using a version of Internet Explorer, it is suggested that you use a different browser, such as Firefox, Safari, or Chrome.

If the “Secure Login” doesn't seem to be working for you, the behavior seems to occur when user passwords contain symbols like quote marks and asterisks. In which case, you can either:

Syntax

For those unfamiliar, here is a page on wiki editing syntax that can be used here.

Course Notes Wiki

This is a space for members of the UNIX/Linux Fundamentals class to create a source of information reflective and assisting to the course.

Aside from assignments that may have you specifically perform operations here, you should contribute when you encounter any of the following:

DokuWiki wrap plugin

http://www.dokuwiki.org/_media/plugin:wrap_plugin_example2.png

The Link above provides fun ways to jazz up a Wiki page.