http://www.tutorialspoint.com/unix/index.htm
Libor Forst: Shell v příkladech. Matfyzpress 2010. ISBN 978-80-7378-152-1
Especially these examples:
1.1 - 1.9, 1.10 - 1.13, 1.15 - 1.17; 2.1 - 2.6, 2.12 - 2.17; 3 - ed ne, sed ano 3.1 - 3.7, 3.12; 4.1, 4.3, 4.4, 4.6, 4.12, 4.22
http://www.mff.cuni.cz/fakulta/mfp/download/books/forst_-_shell_v_prikladech.pdf (not anymore functional :( )
ls -l -a -d -t -1 (-R -h)
rm, mv, rmdir, mkdir
touch -d -r
cp -r
df -h
pwd
echo, head, tail, wc -l
cat, less, more, tr -s
sed -n (and sed commands s, p)
- sed 's/REGEXP/REPLACEMENT/'
- REGEXP: . * \+ [a-zA-Z0-9] [^abc] \(...\) \| ^ $
- REPLACEMENT: \1, \2, ...
- sed -n '1,4p'
grep -c -n
cut -d -f
read (and $IFS-variable setting)
sort -n -t -k
uniq
printf
ifconfig -a
traceroute / tracepath
ping
/etc/resolv.conf
/etc/hosts
chmod
chown
newgrp
passwd
/etc/passwd
/etc/group
A=value
(( ... ))
A=$(( ... ))
{3..10} # Bash extension
'...'
"...$VARIABLE..."
`command`
>, >>, <, | (pipe)
for COMMAND; do ... done
- for ((i;i<10;i++)); do ... # Bash extension
- for fname in *.cpp; do ...
while COMMAND; do ... done
- while read p1 p2 ...; do ...
if COMMAND; then ... else ... fi
- if ((A<10)); then ... # Bash extension
- if [ -e $FILE ]; then ...
exit
test / [ ... ]
*, ?, [a-z]
#!/bin/bash
...
execute permissions
$0, $1, ..., $9
$#, $*, $$, $!, $?
shift