mostra indirizzo IP ifconfig spazio libero nel file system: df spazio disponibile: fs lq es: fs lq Volume Name Quota Used %Used Partition user.roby 310000 243156 78% 0% per sapere la shell di default: echo $SHELL per sapere in quale shell ci troviamo: echo $0 conta numero di righe, parole e caratteri in un file: wc filename lista del contenuto della directory: ls directory lista le dimensioni dei file in ordine decrescente: ls -lSr lista anche la data di ultima modifica e i file nascosti: ls -ltra directory cambia directory: cd directory mostra la directory corrente: pwd crea directory: mkdir directory cancella directory vuota: rmdir directory cancella directory con tutti i contenuti: rm -r directory copia file: cp filename1 filename2 cambia nome al file: mv filename1 filename2 cancella un file: rm -i filename stampa il contenuto del file: cat filename stampa il contenuto delle ultime 10 linee di un file: tail filename sostituisci una stringa tr 'striga uno' stringa due' cat filename | tr 'str' 'str2' cerca un file in tutte le sottodirectory: find . -name filename cerca i file con dimensione superiore a 100 kbyte find . -size +100k cerca una parola in un file, indipendentemente dalle maiuscole: grep -wi parola filename cerca la "stringa" in un file: grep 'stringa' filename cerca la "stringa" in tutti i file (comprese sottodirectory): grep -r 'stringa' . cerca la "stringa1" or "stringa2": grep 'stringa1\|stringa2' filename cerca la "stringa1" and "stringa2": grep 'stringa1' filename | grep 'stringa2' cerca le righe che non contengono la "stringa": grep -v 'stringa' filename grep help file viewer: more filename file viewer (si possono usare le frecce, / per search, q per uscire): less filename dorme n secondi prima di continuare: sleep n separatore di comandi: sleep 5; more filename zip di un file: gzip filename unzip di un file: gunzip filename.gz crea un file archivio del contenuto di una directory: tar cvf nomefile.tar directory spacchetta l'archivio: tar xvf nomefile.tar crea file archivio compresso: tar cvzf nomefile.tgz directory spacchetta l'archivio compresso: tar xvzf nomefile.tgz lista processi: ps -l kill del processo n: kill n link simbolico: ln -s filename filenamelink snapshot del video: import name.png display.png ------------------------networking login remoto: ssh galilinux.pi.infn.it -lroby ssh roby@galilinux.pi.infn.it login remoto enable trusted X11 forwarding and authentication: ssh -AY robby@lxplus.cern.ch copia un file in remoto: scp roby@galilinux.pi.infn.it:public/filename . copia ricorsivamente una directory in remoto: scp -r directory roby@galilinux.pi.infn.it:public test di un nodo remoto: ping galilinux.pi.infn.it restituisce l'indirizzo IP di un nodo remoto: host galilinux.pi.infn.it nslookup galilinux.pi.infn.it comando (root) per far ripartire la rete: /etc/rc.d/init.d/network start /sbin/service network start ottiene un ticket per Kerberos: kinit robby@CERN.CH ------------------install pem certificate in lxplus Export the p12 certificate from Firefox Place the p12 certificate file in the .globus directory of your home area. cd ~/.globus mv /path/to/mycert.p12 . Execute the following shell commands: rm -f usercert.pem rm -f userkey.pem openssl pkcs12 -in mycert.p12 -clcerts -nokeys -out usercert.pem openssl pkcs12 -in mycert.p12 -nocerts -out userkey.pem chmod 400 userkey.pem chmod 400 usercert.pem https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookStartingGrid#ObtainingCert ------------------accounting crea nuovo account (solo root) /usr/sbin/adduser login_name passwd ligon_name visualizza spazio disponibile: fs lq visualizza protezioni afs di una directory: fs la dir modifica protezione afs di una directory: fs sa dir system:anyuser lr modifica protezione afs per un utente fs sa /afs/pi.infn.it/www/esperimenti/cms/pixel username rlidwka check di un filesystem fsck /dev/sda1 ------------------LSF submit a job chmod 777 jobname bsub -q 8nh -o outputfile jobname -> submit in the queue 8nh bsub -B jobname -> send an email at starting job bsub -N jobname -> send an email at the end of job bqueues -> show the queues bjobs -> show the running jobs bpeek -> show the output bkill jobid -> kill a job Quick Reference Note: Not all command options are presented here. For a complete list of options, see the appropriate man pages. See the status of all queues: bqueues [options] [queue_name] -l Long format See the status of submitted jobs: bjobs [options] [jobid] -a Report about all jobs, regardless of status -d Report about recently finished jobs only -p Report about pending jobs only -s Report about suspended jobs only -r Report about running jobs only -q queue Report about jobs submitted to a particular queue only -u user Report about jobs owned by a particular user only jobid Report about a particular submitted job only Submit a job: bsub [options] command [args] -q queue Submit to a particular queue, rather than the default -o file Send job ouput to the named file [args] Options for the submitted job See the history of a submitted job: bhist [options] [jobid] -l Long format -a Report about finished and unfinished jobs -d Report about finished jobs only -p Report about pending jobs only -r Report about running jobs only -s Report about suspended jobs only -q queue Report about jobs submitted to a particular queue only -u user Report about jobs submitted by a particular user only jobid Numeric identifier as reported by bsub See the output from an unfinished job: bpeek jobid jobid Numeric identifier as reported by bsub Switch a submitted job to another queue: bswitch destQ jobid destQ Queue the already submitted job will be switched to jobid Numeric identifier as reported by bsub Kill a submitted job: bkill jobid jobid Numeric identifier as reported by bsub Suspend a submitted job: bstop jobid jobid Numeric identifier as reported by bsub Resume a user-suspended job: bresume jobid jobid Numeric identifier as reported by bsub