Skip to content

Commit ec7aa96

Browse files
committed
Make split out to another repo, add texinfo
1 parent 63278c7 commit ec7aa96

File tree

141 files changed

+1547
-2410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1547
-2410
lines changed

README.md

+37-25
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
2525
1. [Distros](distros.md)
2626
1. [Minimal distros](minimal-distros.md)
2727
1. [Kernel](kernel/)
28-
1. [System Call](system-call/)
28+
1. [System Call](system-call.md)
2929
1. [sysctl](sysctl.md)
3030
1. [dmesg](demesg.md)
3131
1. [installkernel](installkernel.md)
@@ -38,6 +38,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
3838
1. [lsb_release](lsb_release.md)
3939
1. [uname](uname.md)
4040
1. Hardware
41+
[cpuid](cpuid.md)
4142
[lspci](lspci.md)
4243
1. [Filesystem](filesystem.md)
4344
1. [File permissions](file-permissions.md)
@@ -91,7 +92,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
9192
1. [CD DVD](cd-dvd.md)
9293
[isoinfo](isoinfo.md)
9394
[eject](eject.md)
94-
1. [Terminal](terminal.md): terminal emulators, ANSI escapes, control characters
95+
1. [Terminal](terminal.md): terminal emulators, ANSI escapes, control characters
9596
1. [Guake](guake.sh)
9697
1. Stream and file manipulation
9798
1. [cat](cat.md)
@@ -131,33 +132,40 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
131132
1. [wdiff](diff.md)
132133
1. Programming
133134
1. [ack](ack.sh)
135+
1. Analytics
136+
1. [cloc](cloc.md)
137+
1. [sloccount](sloccount.md)
134138
1. [ctags](ctags/)
135139
1. [cscope](cscope.md)
136140
1. Build systems
137141
1. [make](make/)
138142
1. [autotools](autotools/)
139143
1. Processes
140-
1. [Shebang](shebang/)
141-
1. [chroot](chroot.sh)
142-
1. [env](env.sh)
143-
1. [free](env.md)
144-
1. [htop](htop.md)
145-
1. [jobs](jobs.sh)
146-
1. [kill](kill.sh)
147-
1. [killall](killall.sh)
148-
1. [lsof](lsof.md)
149-
1. [nice](nice.sh)
150-
1. [nohup](nohup.sh)
151-
1. [ps](ps.md)
152-
1. [pstree](pstree.sh)
153-
1. [pwd](pwd.sh)
154-
1. [sleep](sleep.sh)
155-
1. [strace](strace.md)
156-
1. [timeout](timeout.md)
157-
1. [top](top.md)
158-
1. [umask](umask.md)
159-
1. [ulimit](ulimit.md)
160-
1. [wait](wait.sh)
144+
1. [Shebang](shebang/)
145+
1. [chroot](chroot.sh)
146+
1. [env](env.sh)
147+
1. [free](env.md)
148+
1. [htop](htop.md)
149+
1. [jobs](jobs.sh)
150+
1. [kill](kill.sh)
151+
1. [killall](killall.sh)
152+
1. [lsof](lsof.md)
153+
1. [ltrace](ltrace.md)
154+
1. [nice](nice.sh)
155+
1. [nohup](nohup.sh)
156+
1. procps
157+
1. [pmap](ps.md)
158+
1. [ps](ps.md)
159+
1. [parallel](parallel.md)
160+
1. [pstree](pstree.sh)
161+
1. [pwd](pwd.sh)
162+
1. [sleep](sleep.sh)
163+
1. [strace](strace.md)
164+
1. [timeout](timeout.md)
165+
1. [top](top.md)
166+
1. [umask](umask.md)
167+
1. [ulimit](ulimit.md)
168+
1. [wait](wait.sh)
161169
1. Date and time
162170
1. [cal](cal.md)
163171
1. [ddate](ddate.md)
@@ -173,7 +181,6 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
173181
1. [GIMP](gimp.md)
174182
1. [gnuplot](gnuplot)
175183
1. [imagemagick](imagemagick.md)
176-
1. [Markup](markup/): Markdown, RST. Focus on command line interface and extensions
177184
1. [Video](video.md): videos, films, subtitles
178185
1. File sharing
179186
1. [Dropbox](dropbox.md)
@@ -210,14 +217,16 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
210217
1. Character encoding
211218
1. [Unicode](unicode.md)
212219
1. [iconv](iconv.sh)
213-
1. Markup compilers
220+
1. Markup
214221
1. [Kramdown](kramdown/)
215222
1. [Pandoc](pandoc/)
216223
1. [RST](rst/)
217224
1. [Virtualization](virtualization.md)
218225
1. [Docker](docker/)
219226
1. [QEMU](qemu.md)
227+
1. [Xen](xen.md)
220228
1. [Vagrant](vagrang/)
229+
1. [Intel SDE](intel-sde.md)
221230
1. [Configuration automation](config-automation.md)
222231
1. [chef](chef/)
223232
1. [puppet](puppet.md)
@@ -227,6 +236,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
227236
1. [lpstat](lpstat.md)
228237
1. [lpoptions](lpoptions.md)
229238
1. [system-config-printer](system-config-printer.md)
239+
1. [ink](ink.md)
230240
1. Mathematics
231241
1. [bc](bc.md)
232242
1. [factor](factor.md)
@@ -262,3 +272,5 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
262272
1. File sharing
263273
1. [NFS](nfs.md)
264274
1. [LDAP](ldap.md)
275+
1. Markup
276+
1. [Texinfo](texinfo.md)

alternatives.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ Major alternatives:
99

1010
- <https://en.wikipedia.org/wiki/IBM_AIX>, IBM system V based
1111
- <https://en.wikipedia.org/wiki/HP-UX>, HP system V based
12-
- <https://en.wikipedia.org/wiki/QNX>, strict real time and micro-kernel, bought by BlackBerry.
12+
13+
Strict real time:
14+
15+
- <https://en.wikipedia.org/wiki/QNX>, proprietary, micro-kernel, bought by BlackBerry.
16+
- <https://en.wikipedia.org/wiki/VxWorks>, proprietary
17+
- <https://en.wikipedia.org/wiki/ECos> GPL, started by Cygnus, discontinued by Red Hat, copyright later transfered to the FSF.

autotools/hello-world/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Get started:
1010
autoconf_hello_world
1111
sudo make uninstall
1212

13+
Most useful things to get started:
14+
15+
- `./configure --prefix`
16+
- `make install DESTDIR`
17+
1318
## What to gitignore on a real project
1419

1520
In normal projects, the files generated by the `autoreconf --install` command are also checked in with Git.
@@ -18,6 +23,8 @@ We `.gitignore` them here for minimality.
1823

1924
## Configure
2025

26+
### prefix
27+
2128
### Installation prefix
2229

2330
../configure --prefix="$(pwd)/install"
@@ -28,3 +35,21 @@ This is:
2835

2936
- very instructive to see what is getting built on large projects
3037
- useful to prepare `chroot` environments
38+
39+
## Makefile
40+
41+
### DESTDIR
42+
43+
Modify the installation destination for a single run, without rerunning `config` with a different prefix:
44+
45+
make install DESTDIR="$(pwd)/../install2"
46+
47+
This will install the programs under:
48+
49+
$(pwd)/../install2/usr/local/
50+
51+
supposing that the prefix is `/usr/local`.
52+
53+
This is very useful to make test installs without modifying the system.
54+
55+
It may be important to not rerun `config` because that requires a `make distclean && make`, which could take hours for large projects.

awk.sh

+95-38
Original file line numberDiff line numberDiff line change
@@ -2,74 +2,129 @@
22

33
# POSIX 7. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html
44

5-
# Turing Machine, but use only for *ultra simple* POSIX text table field manipulation:
5+
# Turing complet, but use only for *ultra simple* POSIX text table field manipulation,
6+
# e.g.: if a column equals X, print Y.
7+
68
# it only has better golfing on that very limited problem set.
79

8-
# For more sanity, use Perl or Python.
10+
# For more sanity, use Python.
911

10-
## variables
12+
## Basic examples
1113

12-
#same as c
14+
# Example of where you should use it: print second column is the first is `'a'`:
1315

14-
#initialized to 0.
16+
printf 'a 1\nb 2\na 3' | awk '$1 == "a" { print $2 }'
1517

16-
#$0: entire record
17-
#$\n: fields
18-
#last field: $(NF-1)
18+
# Numeric comparison: print col 2 if col 1 equals 1:
1919

20-
## FS
21-
#field (column) separator
22-
#FS=':' FS=/[[:space:]]/ -F'/[[:space:]]/'
23-
#OFS: output field separator
24-
#RS: record (line) separator
25-
#ORS: output ""
26-
#NF: number of fields
27-
#NR: number of current record
28-
#FNR: total number of records in cur file
20+
printf '01 a\n2 b\n001 c' | awk '$1 == 1 { print $2 }'
2921

30-
#- arithmetic: same as C: +, *, -, /
22+
# Simple arithmetic operations:
3123

32-
#- string comp: `==` and `!=`
24+
printf 'a 01\nb 2\na 3' | awk '$2 == 1 { print $1 }'
3325

34-
#- posix string ERE regex comp: ~// !~// (sub match accepted unless you use `^$`)
26+
# Line number operations: print every nth line:
3527

36-
#- if else for while: like C
28+
seq 10 | awk 'NR % 3 == 0'
29+
30+
# Line number operations: delete every nth line:
31+
32+
seq 10 | awk 'NR % 3 != 0'
33+
34+
# GNU sed can do those with the `~` extension:
35+
# http://superuser.com/questions/396536/how-to-keep-only-every-nth-line-of-a-file
36+
37+
## General syntax
38+
39+
# Similar to sed.
3740

38-
## general syntax
41+
# A general awk program is of the type:
3942

40-
#A general awk program is of the type:
43+
# BEGIN { STATEMENT_BEGIN }
44+
# CONDITION0 { STATEMENT0 }
45+
# CONDITION1 { STATEMENT1 }
46+
# ...
47+
# CONDITION_N { STATEMENT_N }
48+
# END { STATEMENT_END }
4149

42-
#BEGIN { STATEMENT_BEGIN }
43-
#CONDITION0 { STATEMENT0 }
44-
#CONDITION1 { STATEMENT1 }
45-
#...
46-
#CONDITION_N { STATEMENT_N }
47-
#END { STATEMENT_END }
50+
# To put multiple statements on a single lime, use `;`.
4851

4952
printf '1 2\n3 4' | awk 'BEGIN{print "b"}1<2{print "l"}1<2{print "l2"; print "l3"}1>2{print "l4"}END{print "e"}'
5053
#$'b\nl\nl2\nl3\nl\nl2\nl3\ne
5154

52-
echo '0.5 0.5' | awk '{print $1+$2}'
55+
echo '0.5 0.5' | awk '{print $1 + $2}'
5356
#1
5457

55-
## string num conversion
58+
# If a statment is missing, print is implied:
59+
60+
[ "$(echo 'a' | awk '1')" = 'a' ] || exit 1
61+
62+
# If a condition is missing, 1 (true) is implied:
63+
64+
[ "$(echo 'a' | awk '{print}')" = 'a' ] || exit 1
65+
66+
## Variables
67+
68+
# Same as c
69+
70+
# Initialized to 0.
71+
72+
# $0: entire record
73+
# $\n: fields
74+
# last field: $(NF-1)
75+
76+
## FS
77+
78+
# Field (column) separator.
5679

57-
awk 'BEGIN{print "1"+1}'
58-
awk 'BEGIN{print " 1"+1}'
80+
# FS=':' FS=/[[:space:]]/ -F'/[[:space:]]/'
81+
82+
## OFS: output field separator
83+
84+
## RS: record (line) separator
85+
86+
## ORS: output ""
87+
88+
## NF: number of fields
89+
90+
## NR: number of current record
91+
92+
## FNR: total number of records in current file file
93+
94+
#- arithmetic: same as C: +, *, -, /
95+
96+
#- string comp: `==` and `!=`
97+
98+
#- posix string ERE regex comp: ~// !~// (sub match accepted unless you use `^$`)
99+
100+
#- if else for while: like C
101+
102+
## String to int
103+
104+
awk 'BEGIN {print "1"+1}'
105+
awk 'BEGIN {print " 1"+1}'
59106
#2
60107

61108
## print
62109

63-
awk 'BEGIN{print "a", 1}'
110+
awk 'BEGIN {print "a", 1}'
64111
#'a 1'
65-
#by default, print does space separation
66-
awk 'BEGIN{print "a" "b"}'
112+
# by default, print does space separation
113+
114+
awk 'BEGIN {print "a" "b"}'
67115
#'ab'
68116
#string concat
69117

118+
# Without arguments, it defaults to `print $0`:
119+
70120
[ "$(echo 'a' | awk '{print}')" = 'a' ] || exit 1
71121

72-
## applications
122+
# Note that the default action is to print:
123+
124+
[ "$(echo 'a' | awk '1')" = 'a' ] || exit 1
125+
[ "$(echo 'a' | awk '1;1')" = "$(printf "a\na")" ] || exit 1
126+
127+
## Applications
73128

74129
# Print second field of all entries if first field equals a given integer value:
75130

@@ -92,7 +147,9 @@
92147
# Record separator.
93148

94149
# `''` is a special value that selects blank lines, i.e. paragraphs:
95-
# http://unix.stackexchange.com/questions/82944/how-to-grep-for-text-in-a-file-and-display-the-paragraph-that-has-the-text/82958#82958
150+
151+
# - http://unix.stackexchange.com/questions/136218/grep-sed-or-awk-print-entire-paragraph-in-a-file-on-pattern-match
152+
# - http://unix.stackexchange.com/questions/82944/how-to-grep-for-text-in-a-file-and-display-the-paragraph-that-has-the-text/82958#82958
96153

97154
[ "$(printf '1 a0\na1\na2\n\nb0\nb1\nb2\n\nc0\nc1\nc2\n' | awk -v RS='' '/b1/')" = "$(printf 'b0\nb1\nb2')" ] || exit 1
98155

bsd.md

+7
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ Main variants:
1818
- FreeBSD
1919
- OpenBSD
2020
- NetBSD
21+
22+
Major users: <https://www.freebsdfoundation.org/testimonials> include:
23+
24+
- WhatsApp
25+
- Netflix
26+
- Xinuous
27+
- Experts Exchange

busybox.md

+8
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ BusyBox also implements a version `init`, which is capable of reading `/etc/init
3737
Even though Ubuntu 14.04 does not have it installed by default, its boot system adds it to the `/boot/initrd*` files. Poetically speaking, the initial boot environment has characteristics of an embedded system.
3838

3939
It is then the job of `init` to mount
40+
41+
## Internals
42+
43+
BusyBox uses the kernel's Kconfig mechanism.
44+
45+
In particular, it is affected by variables like `KBUILD_OUTPUT` just like the kernel, and has identical targets like `defconfig` and `mrproper`.
46+
47+
Unlike the kernel, the `KBUILD_OUTPUT` directory must exist before running `make`... Why?

0 commit comments

Comments
 (0)