28 maj 2008

Wyświetlenie danych usera w linux

wyświetlanie : usera, hasła, katalogu domowego 

cat /etc/passwd | awk -F : '{print $1, $2, $6}'

wojtek:x:510:504::/home/wojtek:/bin/bash

- podział stringa na pola, przy wykorzystaniu sepaeratora ':'

20 maj 2008

Definicja VirtualHosta

<VirtualHost 10.1.0.2>
    ServerAdmin admin@kody.wig.pl
    DocumentRoot /usr/local/www/
    ServerName kody2.wig.pl
    RewriteEngine on
    RewriteLog /dev/null
    RewriteLogLevel 0
</VirtualHost>

definicja VirtualHosta

15 maj 2008

Uruchamianie skryptu do programu AWK

awk -f program_awk < test.txt
skrypt zliczy ilość nie pustych lini w pliku test.txt

zawartosc sktyptu program_awk:

NF == 1 { print $0; nl++; next }
END { print ":" nl }