diff options
author | P. J. McDermott <pjm@nac.net> | 2011-11-04 14:20:32 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2011-11-04 14:20:32 (EDT) |
commit | 45c8f12b620eea28b818d9f23447328aeb1e9d8f (patch) | |
tree | 3e1cf8389e6f8402a8719fff41ffdafad2586dfe /topics | |
download | sig-gnu-linux-notes-45c8f12b620eea28b818d9f23447328aeb1e9d8f.zip sig-gnu-linux-notes-45c8f12b620eea28b818d9f23447328aeb1e9d8f.tar.gz sig-gnu-linux-notes-45c8f12b620eea28b818d9f23447328aeb1e9d8f.tar.bz2 |
Initial commit.
Diffstat (limited to 'topics')
-rw-r--r-- | topics/boot.txt | 63 | ||||
-rw-r--r-- | topics/shell-tut.txt | 126 | ||||
-rw-r--r-- | topics/shell.txt | 131 | ||||
-rw-r--r-- | topics/topics.txt | 12 |
4 files changed, 332 insertions, 0 deletions
diff --git a/topics/boot.txt b/topics/boot.txt new file mode 100644 index 0000000..3d03935 --- /dev/null +++ b/topics/boot.txt @@ -0,0 +1,63 @@ +BIOS + firmware image on ROM chip + ROM is either a dual in-line package or plastic leaded chip carrier + POST + initializes HW, e.g. memory, video card, keyboard, USB hosts + finds a bootable device (HDD, ODD, USB flash drive, etc.) + reads MBR and executes stage 1 boot loader +boot loader, e.g. GNU GRUB + may offer user OS list and/or some other interactive IX (e.g. CLI) + will load a kernel, e.g. Linux, into memory and begin its execution +Linux + initializes memory, interrupts, etc. + may mount initial ramdisk + loads and schedules init and kernel threads +initial ramdisk + finds root filesystem + loads required drivers and runs required utilities to mount root fs + e.g. for RAID, LVM2, ext4 + checks for a suspend-to-disk virtual memory image and resumes if found + look at initrd on Debian: + $ gunzip -c /boot/initrd.img-`uname -r` | cpio --extract + warning: will extract to current working directory +init + multiple implementations + GNU/Linux: + System V-style init + systemd + Upstart + runit + OpenRC + Initng + BSDs: + own lightweight and modular daemon + BusyBox/Linux: + own lightweight daemon + SysV-style: + runlevels + 0 - halt + 1 - single-user mode + 2-5 - multi-user mode + 6 reboot + reads /etc/inittab + default runlevel + actions of runlevels + Ctrl+Alt+Del behavior + programs to control TTYs (e.g. /sbin/getty) + etc. + runs initialization scripts + `/etc/rcN.d/* start`, where N = runlevel + links to /etc/init.d/* + cron, servers, ACPI daemon, Network Manager, DMs, etc. +getty + prints /etc/issue, unless disabled + prompts for username + calls /bin/login +login + prompts for password + loads user environment + starts user's default shell (e.g. /bin/bash) +display manager + starts X.org server + prompts for user name and password + starts window manager and desktop shell diff --git a/topics/shell-tut.txt b/topics/shell-tut.txt new file mode 100644 index 0000000..0a73cb0 --- /dev/null +++ b/topics/shell-tut.txt @@ -0,0 +1,126 @@ +first steps and basic output + how shell reads input - three methods + use of "echo" built-in utility + ex: hello world +simple commands, field splitting, and quoting + ex: maybe cd, mkdir/touch, etc. +tilde and pathname expansion + ex: cd with tildes + ex: cd/mkdir/touch with pathname expansions +parameters + defining variables and expanding their values + positional parameters, special parameters, and shell variables + ex: assign variables + ex: expand and print variables and positional parameters +command substitution + ex: commands in subshells, output assigned to variables +arithmetic expansion + ex: some expressions, assignments, etc. +shell commands + revisit simple commands + command search and execution + pipelines + lists + sequential + asynchronous + AND + OR + compound commands + grouping + subshell vs current shell, shell execution environment: + open files + working directory + shell parameters + shell functions + shell options + shell aliases + if + show "test"/"[" command + while + ex: loop over positional parameters + #! /bin/sh + while [ $# -gt 0 ]; do + printf '%s\n' "$1" + shift + done + ex: read from input + until + for + case + functions +exit status +I/O redirection +built-in utilities + colon + export + break [n] + continue [n] + dot + eval + exec + exit + export + return + set + shift + unset +utilities + cat + cd + chgrp + chmod + chown + cp + date + dd + df + diff + dirname + du + echo + expr + false + file + fold + getopts + grep + head + id + kill + ln + lp + ls + mailx + mesg + mkdir + mkfifo + more + mv + nice + pr + printf + ps + pwd + read + rm + rmdir + sed + sh + sleep + sort + stty + tail + test + time + touch + tr + true + uniq + wc + who + +example scripts: + screen-batt + /usr/local/lib/pjrand.sh and /usr/local/bin/screensaver + /bin/which of Debian (ex. of IFS) + changelog-gen diff --git a/topics/shell.txt b/topics/shell.txt new file mode 100644 index 0000000..d98d249 --- /dev/null +++ b/topics/shell.txt @@ -0,0 +1,131 @@ +introduce the shell interpreter + POSIX.1-2008 XCU 2.1 + shell reads input from: + a specified file, + '-c' option argument, or + stdin (interactive mode) + shell splits input lines into tokens and parses them + shell expands words + shell performs I/O redirection + shell executes functions, built-in commands, files, etc. +parameters and variables + positional parameters + POSIX.1-2008 XCU 2.5.1 + decimal numbers greater than 0, e.g. $1 and $2 + multiple-digit numbers should be enclosed in braces + assigned with: + shell arguments when shell starts + function arguments when a function is called + can be reassigned using 'set' built-in command + special parameters + POSIX.1-2008 XCU 2.5.2 + @ + all positional parameters + * + all positional parameters + # + number of positional parameters + ? + exit status of most recent command pipeline + - + current option flags + $ + process ID of shell + ! + process ID of most recent background command + 0 + name of shell or shell script + shell variables + POSIX.1-2008 XCU 2.5.3 + HOME + pathname of user's home directory + IFS + delimiters for field splitting + default: <space> <tab> <newline> + LINENO + line number of current script, if any + PATH + list of paths which should be searched for commands + PS1 + prompt value to be expanded and written to standard error + default value: "$ " + PWD + absolute pathname of the current working directory +word expansions + tilde expansion + POSIX.1-2008 XCU 2.6.1 + tilde-prefix: unquoted tilde at the beginning of a word + followed by all unquoted characters until first unquoted slash + login name is all characters in tilde-prefix following tilde + if login name is empty (tilde-prefix == "~") + expanded to value of HOME + else + expanded to home directory associated with login name + parameter expansion + POSIX.1-2008 XCU 2.6.2 + ${expression} or $expression + expression: + parameter + parameter:-word + parameter:=word + parameter:?word or parameter:? + parameter:+word + #parameter + parameter%word + parameter%%word + parameter#word + parameter##word + command substitution + POSIX.1-2008 XCU 2.6.3 + $(command) + or + `command` + expanding: + shell executes command in a subshell + shell replaces substitution with stdout of the command + newlines within command are allowed + nesting + `command1 \`command2 foo\` bar` + $(command1 $(command2 foo) bar) + arithmetic expansion + POSIX.1-2008 XCU 2.6.4 + $((expression)) + expanding: + shell processes expression + shell replaces substitution with value of the expression + arithmetic: + signed long integer precision + decimal, octal, and hexadecimal constants + e.g. 42, 052, 0x2A + operators: + ( ), unary +, unary -, +, -, *, /, % + ~, !, <<, >>, &, ^, | + <, <=, >, >= ==, !=, &&, ||, expr ? expr : expr + =, +=, -=, *=, /=, %=, <<=, >>=, &= ^=, |= + shell variables + if x has an integer value, then the following are equivalent: + $((x + 1)) $(($x + 1)) + field splitting + POSIX.1-2008 XCU 2.6.5 + IFS is a set of delimiters, at which unquoted fields are split + pathname expansion + POSIX.1-2008 XCU 2.6.6 + POSIX.1-2008 XCU 2.13 + performed unless 'set -f' was run + patterns + ? matches any single character + * matches multiple (0 or more) characters + [ opens RE bracket expansion + if pattern does not match any existing files + pattern string is left unchanged +redirection + input redirection + [n]<word + n: optional file descriptor number (default: 0, stdin) + word: name of file + output redirection + [n]>word + [n]>|word + n default: 1, stdout + appending redirected output + [n]>>word diff --git a/topics/topics.txt b/topics/topics.txt new file mode 100644 index 0000000..31bd704 --- /dev/null +++ b/topics/topics.txt @@ -0,0 +1,12 @@ +mdadm RAID +Linux LVM2 +signals and threads +introduction to the UNIX shell +usage of dd +overview of GNU Screen +set up a server + do stuff with it, I don't know + +projects? + GNU/Linux or BusyBox/Linux, LFS-style + server |