Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
{}
[]
~
`
'
KDE
AltGr+7/0
AtGr+8/9
AlrtGr+
AltGR '
login
logout (in
exit
(in
shutdown -h
shutdown -r
shutdown -r
tty1-6
AltGr+8/9
(tastiera)
AltGr+0
apici inversi (backward quotes, backtiks)
"apici in avanti" forward quotes
login shell)
Konsole)
now
now
1
Ctrl+Alt+Esc
Xkill
Alt+Ctrl+Backspace
kill X
Alt+Ctrl+F1...F7(X)
cambia console (da tty7)
Alt+F1..F7
cambia console (da tty1-6)
LAlt+RSist+r
Raw keyboard (-->killX)
LAlt+RSist+s, e, i, u, b
Sync, tErm, K<I>ll, Umount, reBoot
"Raising Skinny Elephants Is Utterly Boring"
Bash shortcuts
selezione: copia - tasto centrale mouse: incolla
frecciasu, gi: History (max HISTSIZE, ricordata dopo la riaccensione)
Ctrl+a HOME(inizio)
Ctrl+e END(fine)
Ctrl+f -> (lettera)
Ctrl+b <- (lettera)
Ctrl-p freccia su - PGUP (hystory)
Ctrl-n fraccia gi - PGDWN(hystory)
Ctrl+h BKSPCE
Ctrl+d DEL
Ctrl+m,o ENTER
Ctrl+i TAB completamento automatico directory/file
Ctrl+y INS incolla
Alt+f ESC f --> (parola)
Alt+b ESC b <-- (parola)
Alt+Ctrl+b/f non va (canc. parola prima/dopo)
Ctrl+w cancella parola prima/...
Ctrl+d exit shell se linea vuota
Ctrl+k cancella tutto dopo
Ctrl+c interr programma / cancella modifica riga
Ctrl+l = clear (comando)
Ctrl-r search hystory
Ctrl+s interr flusso caratteri
Ctrl+q riprendi flusso caratteri
;
due comandi sulla stessa riga
&&
due comandi sulla stessa riga
Processi in
programma &
CTRL-Z
jobs
bg
bg <n>
Background
(avvia il programma in background)
(interrompe il programma corrente e lo manda in bg)
(programmi in bg, <n>, + l'ultimo, run/stopped)
(avvia l'ultimo in background)
(avvia il processo <n> in background)
fg
fg <n>
chsh
clear
echo
echo Ciao $USERNAME
nohup
sleep
usleep
Completamento automatico avanzato: Esc (o Ctrl+x)_seguito_ da:
! comandi
/ files, directories
~ users
@ hosts
$ variabili ambiente
<Esc $>
...dtutte le variabili di ambiente
man di <Esc !>
...dle pagine man iniziano per "di"
Metacaratteri - Glob - Regular expressions
*
(qualsiasi sequenza di di caratteri, anche nessuno!)
?
un cattere qualsiasi
[A-M]
un carattere, da A fino a M compresi
[a-dJW-Y] un carattere da a-d, o J, o un carattere da W-Y
[!...]
un carattere, esclusi quelli indicati
{a,c,f} un carattere tra: a, c oppure f
Esempi: [a-zBE5-7]
ogni minuscola seguita da BE seguita da num. tra 5 e 7
[!a-z]
ogni non minuscola
{[0-9]*,[acr]} ogni cifra seguita da qualsiasi cosa, oppure che
contiene a opp c opp r
Variabili d'ambiente
<Esc $>
echo $PATH
echo Ciao $USERNAME
HOME, PATH (i prog non sono cercati nella dir corr), USERNAME, UID, PS1,
HISTSIZE
MAN
- stampa: man -t xxx >manxxx.ps (poi eventualmente...lpr ps.ps)
- man -k parola - pagine man contenenti una parola (come apropos)
- aggiornare man -k: #/usr/sbin/makewhatis --> #whatis (funziona solo per root)
- man 1 cvs -->cvs(1)
man 5 cvs-->cvs(5)
- info info --apropos (non serve makewhatis) info xxx>info_xxx.txt
- apropos
EDIT
more
less
h q frecce
groff (usato con man -t)
wc
righe-parole-caratteri
tail
strings (testo in file binari)
uniq
sort
cal
bc
expr
TEMPO
at 11.42
>play Documenti/sounds.wav/clock.wav
CTRL-D
cron crontab /etc/cron.daily (eccetera)
anacron
gs -dNOPAUSE -dBATCH -r300 -sOutputFile=file%d.tif -sDEVICE=tiffg4 file.pdf
...which'll create 300 DPI black-and-white TIFFs out of file.pdf, one
TIFF per page. Then, for maximum accuracy, you should feed those TIFFs
through an engine like Omnipage, TypeReader, or FineReader
convert file.pdf file.png
convert file.pdf file.jpg
pdftoppm -png file.pdf prefix
pdftoppm -jpeg file.pdf prefix
pdftoppm -tiff file.pdf prefix
pdftoppm -rx 300 -ry 300 -png file.pdf prefix
SCHERMO
gamma:
xgamma 1.5
risoluzione:
xrandr --> possibilit esistenti
xrandr -s 1600x1200 -r 60
xrandr -s 800x600
NAV
pushd <...> (vai nella nuova dir e annota la vecchia dir),
popd (torna nella predente e scalala dal mucchio)
dirs (lista del mucchio)
pwd
ls -Rasildh
ls <file> <directory>
ls ?ette* (glob expr.)
tree -adsfugpiltDF -L2
all, dir, size, full patch, user, group, protect, no indent,
links (follow), time (sort), Date, Append /,
dircolors
du
...vedi dalla root (attenzione ai permessi)
du -shmcx /mnt /*
summarize, human, megabytes,+total, one file system
...vedi le directory in ordine di ingombro
du -shmc *|sort -nr|less
.. e in MB, directory in ordine di ingombro, totale all'inizio:
du -mc *|sort -nr|less
... la migliore, in kb (un solo livello)
du -ms *|sort -nr
du -ms Documents/*|sort -nr
df (lista partizioni montate) vedi le partizioni e il relativo ingombro
df -h
df -i (inodes)
mc
fr (no man)
cd
cd ~
cd ~<username> cd /
rm -Rif rm -Rf /home/gandi cancella dir, subdir e files
mkdir -p
rmdir
find <path> -iname <file>
grep <testo> <path>
grep descent *
grep -r descent * (recursive)
#updatedb --> $locate d1*
find ./ -type d | du -hm | sort -nr |less (simile a treesize)
wget -rnc -l1 --no-parent
wget -rnc -l1 --no-parent
wget -rnc -l1 --no-parent
wget -rnc -l1 --no-parent
wget -rnc -l2 --no-parent
(recursive no-clobbing)
-A.jpg http://domain.com/pics/33/
-A "*.jpg" http://domain.com/pics/33/
http://programmazione.html.it/python/index.html
-A "[!a-g]*.jpg" http://gonzovision.com/GVPOST/pics/
-A "*" http://antwrp.gsfc.nasa.gov/apod/
PROC
free (memoria libera=free+buffers+cache)
ksysguard (grafico)
top (h o man top)
ps aux
ps aux | less
ps aux | grep <process>
pstree -up | less
kill -9 785
killall wine
xkill (grafico): Ctrl+Alt+Esc
$/sbin/fuser
#fuser -uv /usr/bin/artsd (restituisce il PID+Utente+verbose)
#fuser -k /usr/bin/artsd (kill)
#fuser -km /mnt/estraibile (libera un dispositivo impegnato)
#kill -9 `pidof descent3` (apici inversi: AltGR ')
FILES
>
>>
file
file -a playmidi : path di tutti i pogrammi "playmidi"
which playmidi: quale viene esguito?
cp -Rifv <...> <...> <destinazione>
cp -Rpd (conserva permessi e simlink)
cp -a ./ ../altradir (mirror di una directory completa)(come Rpd)
mv -fiv <file o dir> <file o dir> <file o dir>
rename <stringa1> <stringa2> <file>
sostituisci le occorrenze di stringa1 in stringa2 nei file
rename file file0 file?.txt
file1.txt --> file01.txt
file2.txt --> file02.txt
file3.txt --> file03.txt
rename file file0 file??.txt
file01.txt --> file001.txt
file10.txt --> file010.txt
dd if=/dev/fd0 of=bootimg.DOS
(per fare un file immagine di un FD bootabile DOS, per un CD bootabile)
dd if=/dev/hda of=bootsect.img bs=512 count=1
COMPRESSIONE ARCHIVIAZIONE
tar -czvf archivio.tgz directory (l - facoltativo)
czvf = create, gzip, verbose, file archivio
cjvf = create, bz2, verbose, file archivio
x (extract), u (update), A (catenate), t (list), k (keep-old-files)
gzip, gunzip, zcat
bzip2 file file
bunzip file.bz2
bzcat
MULTIMEDIA
sox (RPM) comprende rec, play, soxmix, soxplay, soxexam
rec test.wav
play test.wav
man soxexam (non un programma, sono istruzioni, incredibili!)
(lame: converte wav in mp3)
lame -h test.wav test.mp3 (128 kbs)
lame -hb 256 test.wav test.mp3 (256 kbs)
mpg123 test.mp3
cdparanoia (CDDA legge CD ed estrae tracce in WAV)
cdparanoia -B (estrae tutte le tracce)
cdparanoia -- "-3" (estrae fino alla traccia 3)
transcode -i starwhores.avi -P 3 -o starwhores.mpg
ffmpeg -i FileVideo.flv -ab 56 -ar 22050 -b 500 -s 320x240 -vcodec xvid -acodec
mp3 VideoConvertito.avi
SINTESI VOCALE
(installato anche libspeech+devel)
$festival --tts /home/gandi/Desktop/inglese.txt
$echo hello | festival --tts
$echo "hello hello hello" | festival --tts
$cat /home/gandi/Desktop/inglese.txt | festival --tts
$festival (modo interattivo)
>(SayText "Good morning")
>(tts "/home/gandi/Desktop/inglese.txt" nil)
Control-d per uscire
(quit) per uscire
text2wave inglese.txt -o fileaudio.riff
q
USERS
whoami
who
w
passwd <ENTER> cambio password utente - chiede passw corrente poi quella nuova
finger
chfn
su
sudo
in /etc/sudoers
root
ALL=(ALL) ALL
gandi ALL=(ALL) NOPASSWD:ALL
SYSTEM
#parted /dev/hda
q, quit
esc -->lista comandi
select /dev/hda
p, print --> lista partizioni
resize 8 14245,167 27933,363
#e2fsck -cfv /dev/hda1
# forza (frammentazione), badblocks, verboso
debugfs
dumpe2fs -h /dev/hdb1 --> un sacco di info (Mount count, Maximum mount)
tune2fs -c 30 /dev/hdb1 --> dopo 30 mount fsck -f /dev/hdb1
mount /dev/hdd5 /mnt/hdd5
badblocks -->
#umount /dev/hda10
-c
-t
-t
-t
-t
-l
(hostname che)
uname -r (display kernel version)
date
dmesg, syslogd, syslog.conf, klogd, logger, services
tail -f /var/log/kern.log (registra le variazioni di hardware collegato e simili
)
(log messaggi boot)
lilo, lilo.conf
mount, fstab, umount, umask
mount -t ext2 /dev/fd0 /mnt/floppy
mount -t iso0660 /dev/hdb /mnt/cdrom
mkbootdisk --device /dev/fd0 2.6.3-15mdk (crea un floppy di boot)
MASTERIZZAZIONE CD
mkisofs -l -R -J -v -o isofile.img directory/ (crea immagine iso della dir)
#mount -o loop isofile.img /mnt/isomnt/ -t iso9660 (monta immagine iso per veder
la)
#umount /mnt/isomnt/
#cdrecord -scanbus (per trovare le coordinate del CD drive) => 1,0,0
#cdrecord dev=1,0,0 -v -eject -speed=6 isofile.img (Masterizza a 6X)
#cdrecord dev=1,0,0 blank=fast (Cancella un CD riscrivibile)
COPIA CD RAW-DAO (CD Musicali per esempio)
cdrdao copy --device 0,0,0 --driver generic-mmc audiocd.toc
legge, scrive file .bin nella dir corrente, si ferma, chiede un CD scrivibile
ALTRO SISTEMA
dd if=/dev/scd0 of=test.iso
(masterizzazione come sopra)
(-b bootabile !)
mkisofs -r -o isofile.img -b boot.img
urpmi (most used)
urpmq --list-media
urmq --list | grep xxx
urpmq --media medianame --list | grep xxx
urpmi.addmedia main_release /mnt/hdd1/mandriva2007/media/main/release with media
_info/hdlist.cz
urpmi.addmedia contrib-updates /ftp.free.fr/./././././contrib/updates with ./me
dia_info/hdlist.cz
--update
Add an "update" medium (for MandrakeUpdate)
--distrib
Add all media from an installation medium
--distrib-XXX XXX may be main, contrib, updates or anything else that has been
configured
--from <url>
Use the url for a mirror list of possible locations
http://www.linux-mandrake.com/mirrorsfull.list DEFAULT,
unless urpmi.setup is installed: look at its mirror configuratio
n file.
urpmi.removemedia <names> Removes a rpms media from the known medias of urpmi
-a
Select all media to remove them.
-c
Clean headers cache directory (/var/cache/urpmi/headers).
urpmq pckgename
urpmq --fuzzy name
urpmq --list-media
urpmq --list
Lists available packages (|grep xxx)
urpmq -i pckgename
Displays summary and description of packagename
urpmq -r pckgename
Print version and release of each packages listed
urpmq -g pckgename
Print group of each packages listed.
urpmq --update Use only update media (search and resolve dependencies).
urpmq --media medianame
Select specific media to use instead of all media ava
ilable
urpmq --sources pckgename Print source url (or file) of all packages selected.
urpmi.update -a
Select all media that are not using a removable device t
o update them.
urpmi.update -c
Clean /var/cache/urpmi/headers directory on exit.
URPMI works by maintaining a local index of all packages available on remote loc
ations. This local list can get out of date and should be refreshed periodically
by redownloading the remote list. This will query every remote source and fetch
the new lists if necessary.
urpmf filename
e)
-c
--update
update.
--media
--files
--provides
--requires
--conflicts
--obsoletes
urpmi mypackage
--clean
/rpms.
--fuzzy
--update
updates and the
--auto
--auto-select
sions.
Select
Search
Search
Search
Search
Search
rpm
rpm
rpm
rpm
-e x
(rimuove)
-ivh --prefix /home/programmi/ x.rpm [--nobuild]
--rebuild x.src.rpm (--> x.rpm)
-K x.rpm check signature
-qpl x.rpm
-ql x.rpm
-qpi x.rpm
-qi x.rpm
(contenuto pacchetto/i
(contenuto pacchetto/i
(descrizione pacchetto
(descrizione pacchetto
non installato/i)
installato/i)
non installato)
installato)
rpm -qa
(query all)
rpm -qa | grep "kernel" (ricerca di un pacchetto)
rpm -qf /usr/lib/libSDL_ttf-2.0.so.0 (--> x.rpm)
rpm -q --whatprovides libGLU.so.1
--> libMesaGLU1-5.0.1-5mdk (il pacch. installato che fornisce il file)
rpm -q --whatrequires libGLU.so.1
--> (lunga lista di pacchetti installati che richiedono il file)
rpm2cpio pacch.rpm > pacch.cpio (converte in cpio)
cpio -t < pacch.cpio
(leggere i file contenuti)
cpio -ivd < pacch.cpio
(estrae /dir/file nella dir corrente)
MODULI
#lsmod (lista dei moduli)
#modprobe <modulo> inserisce modulo e dipendenze
#modprobe -r <modulo> rimuove modulo
#depmode -a genera il file delle dipendenze (al boot)
#modinfo -p <modulo> (parametri ammessi dal modulo)
/etc/modules (indica i moduli da caricare al boot) MAN
/etc/modules.conf (parametri dei moduli) MAN
viene letto da: /etc/rc.d/rc.modules
X
XFree86
XF86Config
xvidtune
DEBUG
$gdb
(gdb)file /usr/usr/bin/d2x-rebirth-gl
(gdb) run -window