Sysadm Linux

We trust you have received the usual lecture from the local System Administrator.
It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

Linux commands and tools

Una lista di comandi usabili da una shell di Linux.

pwdstampa la directory corrente
ls (<percorso>)elenca i file in una directory
cd <percorso>cambia la directory corrente
mv <cosa> <dove>sposta o rinomina un file/directory
cp <cosa> <dove>copia un file/directory
rm <cosa>rimuove un file/directory
mkdir <percorso>crea una o piu’ directory
echo <testo>stampa l’eco
cat <percorso>stampa il contenuto di un file
tac <percorso>stampa il contenuto sottosopra
head <percorso>stampa l’inzio di un file
tail <percorso>stampa la fine di un file
wc <percorso>conta caratteri, parole e righe
sort <percorso>ordina righe
uniq <percorso>rimuove righe consecutive identiche
cut <percorso>stampa una o piu’ colonne
tr <percorso>sostituisce un carattere con un altro
grep <regex> <percorso>seleziona righe in base ad una regex

Linux internals

Ubuntu System Administration

Linux configuration

Linux networking

ip addr                      ifconfig -a
ss                           netstat
ip route                     route
ip maddr                     netstat -g
ip link set eth0 up          ifconfig eth0 up
ip -s neigh                  arp -v
ip link set eth0 mtu 9000    ifconfig eth0 mtu 9000

Linux security

Log Analysis

Linux storage

tgtadm ACL

tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address ALL

Serial communications

Linux customization

Log Analysis

  • GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser
  • AWStats is a free powerful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages
  • Logrotate: Force Log Rotation

AWK Scripts

  • AWK: Efficiently prints lines from a file without duplicates, without sorting (unlike `sort -u`)awk ‘! seen[$0]++’

BASH Scripts

Installazioni di software



openssl smime -decrypt -verify -inform DER -in $file_input_name -noverify -out $file_output_name
curl -I

Bash scripting