The Pythoning

Scrapbooking useful Python programming ephemera and:

"Eating way more food than necessary at a meal, with the intent of stocking up so not to have to eat again for a long time." (from Urban Dictionary).

Apr 27

Apr 12

set - set or unset values of shell options and positional parameters.

-C

(-o noclobber) If set, disallow existing regular files to be overwritten by redirection of output.

-x

Print commands and their arguments as they are executed.

-e

Exit immediately if a command exits with a non-zero status.


Mar 30

dog - better than cat

dog URL

writes URL to stdout

--images

treats input as HTML and lists unique, absolute image links from input data.


locate - find files by name

-i, --ignore-case

Ignore case distinctions when matching patterns.

-b, --basename

Match only the base name against the specified patterns.

-c, --count

Instead of writing file names on standard output, write the number of matching entries only.

-e, --existing

Print only entries that refer to files existing at the time locate is run.

-L, --follow

When checking whether files exist (if the —existing option is specified), follow trailing symbolic links. This causes broken symbolic links to be omitted from the output.

--regex

Interpret all PATTERNs as extended regexps.

-r, --regexp REGEXP

Search for a basic regexp REGEXP. No PATTERNs are allowed if this option is used, but this option can be specified multiple times.


tac - concatenate and print files in reverse

-s, --separator=STRING

use STRING as the separator instead of newline

-r, --regex

interpret the separator as a regular expression

-b, --before

attach the separator before instead of after


tail

-f, --follow

output appended data as the file grows

-s, --sleep-interval=S

with -f, sleep for approximately S seconds (default 1.0) between iterations

--retry

keep trying to open a file even when it is or becomes inaccessible; useful when following by name, i.e., with —follow=name

-F

same as —follow=name —retry


cat - concatenate files and print on the standard output

-n, --number

number all output lines

-b, --number-nonblank

number nonempty output lines

-s, --squeeze-blank

suppress repeated empty output lines

set -o noclobber
set +o noclobber (>|)

allow and prevent redirection of cat accidentally overwriting existing files


Feb 9

Linux middle-click to paste with keyboard

Shift-Insert in terminal



Feb 5
Train exiting from Carrington tunnel.

Train exiting from Carrington tunnel.


Page 1 of 2