11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

arch<br />

lastcomm<br />

lastlog<br />

bash$ uname -s<br />

Linux<br />

Capitolo 13. Coman<strong>di</strong> <strong>di</strong> sistema e d’amministrazione<br />

Mostra l’architettura del sistema. Equivale a uname -m. Ve<strong>di</strong> Esempio 10-26.<br />

bash$ arch<br />

i686<br />

bash$ uname -m<br />

i686<br />

Fornisce informazioni sui coman<strong>di</strong> precedentemente eseguiti, così come sono registrati nel file<br />

/var/account/pacct. Come opzioni si possono specificare il nome del comando e dell’utente. È<br />

una delle utility <strong>di</strong> contabilità GNU.<br />

Elenca l’ora dell’ultimo login <strong>di</strong> tutti gli utenti del sistema. Fa riferimento al file<br />

/var/log/lastlog.<br />

bash$ lastlog<br />

root tty1 Fri Dec 7 18:43:21 -0700 2001<br />

bin **Never logged in**<br />

daemon **Never logged in**<br />

...<br />

bozo tty1 Sat Dec 8 21:14:29 -0700 2001<br />

bash$ lastlog | grep root<br />

root tty1 Fri Dec 7 18:43:21 -0700 2001<br />

Cautela<br />

Il comando fallisce se l’utente che l’ha invocato non possiede i permessi<br />

<strong>di</strong> lettura sul file /var/log/lastlog.<br />

353

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!