Indice dei contenuti
alias cd='readme'
readme() {
TODO=".todo"
cd "$@"
if [ -f "$TODO" ]; then
echo "== TODO =="
cat $TODO
echo ""
fi
}
Per customizzare i messaggi al prompt dopo il login editare /etc/motd e /etc/motd.tail
Interessante articolo che spiega come usare sort per ordinare record secondo i campi:
http://www.cyberciti.biz/faq/linux-unix-sort-date-data-using-sortcommand/
es:
2008 ^ 09 ^ 21 ^ Basta con PHP 2007 ^ 07 ^ 13 ^ Accendi il computer 2008 ^ 12 ^ 17 ^ Impara la Shell cat dati.txt | sort -t^ -k 1 -k 2 -k 3 -n 2007 ^ 07 ^ 13 ^ Accendi il computer 2008 ^ 09 ^ 21 ^ Basta con PHP 2008 ^ 12 ^ 17 ^ Impara la Shell cat dati.txt | sort -t^ -k 3 -n 2007 ^ 07 ^ 13 ^ Accendi il computer 2008 ^ 12 ^ 17 ^ Impara la Shell 2008 ^ 09 ^ 21 ^ Basta con PHP cat dati.txt | sort -t^ -k 4 2007 ^ 07 ^ 13 ^ Accendi il computer 2008 ^ 09 ^ 21 ^ Basta con PHP 2008 ^ 12 ^ 17 ^ Impara la Shell
Common issue
$ ls cache* | wc -l -bash: /bin/ls: Argument list too long 0 $ find . -iname cache* -print | wc -l -bash: /usr/bin/find: Argument list too long 0 $ find cacheSQL* -print | wc -l -bash: /usr/bin/find: Argument list too long 0
Quick solution
$ find . -iname "cache*" -print | wc -l 8873
Per ordinare random le linee di una lista si può utilizzare la variabile $RANDOM.
for i in *; do echo "$RANDOM $i"; done | sort -n | awk '{print $NF}'