Sei sulla pagina 1di 11

TUTTUNIX

{}
[]
~
`
'

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>

(porta l'ultimo in foreground)


(porta il numero n in foreground)

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

Backup your boot sector:


dd if=/dev/hda of=/BootSectorBackup.bin bs=512 count=1
Boot a Linux Rescue Disk. Restore the Boot Sector:
dd if=/BootSectorBackup.bin of=/dev/hda bs=512 count=1
touch <file><file>
touch *
head
cat
cat x*>file.zip (riunisce i file splittati)
cat /etc/fstab /etc/conf.modelus (cerca nella dir corr)
cat lett_1.ps lett_2.ps > lettera.ps
cat > letterina.txt
tac
split split -C 100k file.zip (split -C 1457664 file.zip)
cmp
diff (anche directories, in breve: diff -q)
diff3
diffpp
sdiff
gendiff
patch
pr
chmod -Rvc
777 <file o dir> <file o dir>
chmod ugo-rwx /home/gandi
chown -Rvc <usr.[group]> <file o dir> <file o dir>
chgroup
chattr -RVv -i files... [acdijsuADST]
ln
ln -s filelinkato linkcreato (-s simbolico)
unrar x -kb file.rar
(se l'archivio risulta corrotto dopo un download;
estrae files con fullpath, verifica integrit file per file)
DEBUG
ldd /usr/bin/programma
strace -f /usr/bin/programma
programma

lista le librerie usate dal programma


traccia le chiamate di sistema e i segnali di un

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

#fsck -cv /dev/hda10


frammentazione -->
#umount /dev/hda10
#fsck -f /dev/hda10
controllo disco settori difettosi
#umount /dev/sdb
#badblocks -nvs /dev/sdb
#hdparm
#hdparm
#hdparm
anche:
cpudynd
O)

-d 1 /dev/hda (imposta dma)


-tT /dev/hda (misura velocita')
-Y /dev/hda (arresto disco, riparte in automatico)
-t 0 -h /dev/hdd,/dev/hdb,/dev/hda (spegni dopo 0 secondi di assenza I/

diminuire la frequenza della CPU


#modprobe p4-clockmod
(#lsmod | grep p4)
# cd /sys/devices/system/cpu/cpu0/cpufreq
echo 1000 > scaling_setspeed (va alla cpuinfo_min_freq = 250 Mhz)
cat scaling_setspeed
echo 9999999 > scaling_setspeed (va alla cpuinfo_max_freq = 2000 Mhz)
#mke2fs /dev/hdd1
#mkfs.ext3 /dev/hdd1
recupero di un file dal disco con settori danneggiati:
dd if=fileWithBadBlocks of=recoveredFile bs=4k conv=noerror,sync
stato del disco:
installare smartmontools
#smartctl -i /dev/hda -->info varie (SMART support is: Enabled)
(eventualmente attivare con: #smartctl -s on /dev/hda)
#smartctl -H /dev/hda --> SMART (...): PASSED (se no: BACKUP IMMEDIATO!)
#smartctl -A /dev/hda --> attributi - critici:
1 Raw_Error_Rate (errori correggibili in lettura)
-> 5 Reallocated_Sector_Ct (0, nessun settore riallocato)
7 Seek_Error_Rate (difficolatposiz. su traccia)
#smartctl -l error /dev/hda --> errori registrati e quando (prendere nota delle
ore)
#smartctl -a /dev/hda --> mostra tutto
#smartctl
#smartctl
#smartctl
#smartctl
#smartctl
#smartctl

-c
-t
-t
-t
-t
-l

/dev/hda --> test supportati e stime tempi necessari


offline /dev/hda --> Immediate Offline Test (3 min) (se support.)
short /dev/hda --> (<10 min)
long /dev/hda --> (< circa 1 ora)
conveyance /dev/hda --> errori trasporto (se support.)
selftest /dev/hda --> risultati ultimi test eseguiti

#ksysv (configurazione grafica dei runlevel)


lspci
USB (lista i dispositivi collegati, ottimo per controllare se "vede")
#lsusb
#lsusb -v
hostname domainname nodename dnsdomainname

(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

Asks whether URPMI has ever heard of packagename


Lists all known packages that sound vaguely like name
Lists available 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

Finds the RPM package providing <file> (can be part of a filenam


Ignore case distinctions in any patterns.
It will search and resolve dependencies only in media marked as

urpmi mypackage
--clean
/rpms.
--fuzzy
--update
updates and the
--auto
--auto-select
sions.

Select
Search
Search
Search
Search
Search

specific media to use instead of all media available


through files, this is the default.
through provides.
through requires.
through conflicts.
through obsoletes.

Remove all packages from the cache in directory /var/cache/urpmi


Allow fuzzy search on the package name.
Use only update media. For restricting the upgrades to security
like.
Automatically installs dependencies without asking
Automatically upgrade all packages for which there are newer ver

with --auto and --update, this automatically apply patches.


--noclean
Do not flush the RPM cache. You will find the RPMs in /var/cache
/urpmi/rpms/
--allow-nodeps, --allow-force
If a dependency cannot be filled or there is a conflict, ask the user if he want
s to shoot himself in the foot instead of refusing to go along with the insanity
.
urpmi.cfg
autoirpm
e you tried to
autoirpm-icons

urpmi option and media configuration file format


To automatically install a package corresponding to an executabl
launch
To install all available menu entries of all known packages

escludere pacchetti dall'upgrade (compaiono ma non selezionati)


# kwrite /etc/urpmi/skip.list
# Here you can specify the packages that won't be upgraded automatically
# for example, to exclude all apache packages :
# /^apache/
/^nexuiz/
rpm -ivh x.rpm (installa, lascia le versioni prec.)
rpm -Uvh x.rpm (aggiorna)

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

rpm -V x (verify all)


rpm -Va (verify all)
rpm -Vp x.rpm (corrispondenza tra un pacchetto e l'installato)
rpm
rpm
rpm
rpm

-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

ntp (RPM sul CD1, aggiorna tutto con la Time Zone)


http://www.ntp.org/
ntpdate ntps.net4u.it (galileo ferraris, torino)
#ntpdate www.clock.org
hwclock --systohc &
/etc/ntp.conf
server www.ntp.org/
server ntpdate ntps.net4u.it

"the NTP socket is in use, exiting" --> /etc/init.d/ntpd stop


ntpdate -d ntps.net4u.it (diagnosi collegamento)
ntpq -p mostra il funzionamento del demone
FTP - NCFTP(?)
help
help <command>
ftp ftp.descent.it (feldspar@descent.it, "password")
open ftp.descent.it (feldspar@descent.it, "password")
open ftp.infinito.it
close, disconnect
quit
cd
pwd
lcd (local cd)
ls, dir
del <file>
binary(sempre) ascii
hash
get <file>
mget <*xxx>
put <file>
mput <*xxx>
http://web.tiscali.it/simona.albini/sabbio.zip
web.tiscali.it
simona.albini@tiscali.it
-----------------------------------------------------------------------------------SOTTOTITOLI SUBTITLES SUBTITLING
-----------------------------------------------------------------------------------transcode -i videofile.avi -x mplayer="-sub subfile.xxx" -o outputfile.avi -y xv
id
(provato, funziona)
-----------------------------------------------------------------------------------mencoder -ovc xvid -xvidencopts fixed_quant=5 -oac copy -sub sottotitoli.srt -su
bfont-text-scale 3 -o output.avi input.avi
Se si verifica l'errore seguente:
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Copiare il .ttf del font preferito: /usr/share/fonts/ --> ~/.mplayer e rinominar
lo: subfont.ttf
-----------------------------------------------------------------------------------mencoder -o fileiwantatend.avi -sub subtitlesfile.srt -oac copy -ovc lavc -lavco
pts vcodec=mpeg4:mbd=2:trell theactualmovie.avi
------------------------------------------------------------------------------------

Potrebbero piacerti anche