Sergej Chodarev / 4. december 2023
C:\>quadratic
Turbo Quadratic Equation Solver for MS-DOS
Please, enter the coefficients of the equation
ax^2 + bx + c = 0
a: 4
b: -5
c: 1
The equation has two roots: 1, 0.25
~$ quadratic 4 -5 1
1
0.25
This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.
rpm -qa --qf '%{size} %{name}\n' | sort -nr | less
cat program.hs | ./parser | xsltproc ../viztree.xsl - \
| dot -Tpng > parser.png
ed
(Ken Thompson)ex
(Bill Joy)vi
(Bill Joy)vim
(Bram Moolenaar)dl
— delete + move rightdw
— delete + move to next word3dw
— 3 × (delete + move to next word)daw
— delete a wordA. Cockburn, C. Gutwin, J. Scarr, and S. Malacria
Supporting Novice to Expert Transitions in User Interfaces
ACM Computing Surveys (Nov. 2014)
DOI: 10.1145/2659796
prog > output
prog >> output
prog < input
prog 2> errors
prog 2>&1
prog1 | prog2
When a program has nothing surprising to say, it should say nothing.
ls -a
ls -al
ls --all -l
ls -I '*.png'
ls --ignore='*.png'
--help
--version
return 0;
exit(0);
$?
if cd dir; then
rm *
fi
cd dir && rm *
/etc
#
printenv
export EDITOR=vim
kill -SIGKILL 42
kill -SIGHUP $(cat /var/run/nginx.pid)
rsync --help
man rsync
Buďte liberálni pri prijímaní informácií, ale naopak konzervatívni pri ich odosielaní.
grep
(regulárne výrazy)sed
awk
High-performance tasks require high-performance user interfaces specially designed for those tasks.