FAQ Utenti Linux ENG & ITA
Da Wizard linux team wiki.
ENGLISH:
How do I reboot my machine?
In order to reboot your machine, you must instruct the Linux kernel to stop all the processes (programs) it's currently running. Do not simply press the reboot button on the front of your computer case, as Linux must be properly shut down/restarted. To restart your machine, as root, run either of the following commands in a terminal: reboot shutdown -r now
How do I shut down my machine?
In order to shut down your machine, you must instruct the Linux kernel to stop all the processes (programs) it's currently running. Do not simply press the power off button on the front of your computer case, as Linux must be properly shut down/restarted. To shut down your machine, as root, run either of the following commands in a terminal: halt shutdown -h now
How do I remove/uninstall Lilo/Grub?
If you want to remove the Lilo or Grub boot loader from your system (if you are uninstalling linux etc) follow the procedures below:
For Windows 95/98 etc: Use a dos boot disk and at the command prompt type: fdisk /mbr
For Windows XP: Boot off the XP Installation CD and go into rescue mode. From there run the command: fixmbr
How do I add a user?
While logged in as root, type adduser username at the shell prompt, replacing username with the name you want to use to log in. You can create as many users as you wish, one for each member of your family, for example.
How do I delete a user?
While logged in as root, type userdel username at the shell prompt, replacing username with the user name you wish to delete.
How do I change my login password?
To set the password for a specific user, type (while logged in as root) passwd username at the shell prompt, replacing username with the name of the person who's password you wish to change. By typing just passwd you'll be able to change the password of the user under who's name you're currently logged in as. Do not use passwords which are easy to guess, like your middle name or your pets name.
How do I copy files?
cp - Used to copy files/directories from one location to another Usage: cp file newlocation Example: cp /home/joey/index.html /var/www/index.html Example: cp /home/joey/* /var/www/ (this will copy everything in /home/joey to /var/www/) For more information, in a terminal, type man cp
How do I rename/move files?
mv - Used to move or rename files Usage: mv file location (to move) Usage: mv filename newfilename (to rename) Example: mv index.html /var/www/index.html (to move) Example: mv index.html index2.html (rename) For more information, in a terminal, type man mv
How do I list directory contents?
ls - To list the contents of a directory Usage: ls [flags] directory Example: ls (To list the current directory) Example: ls /home/joey (To list the contents of /home/joey) Example: ls -a (To list hidden files) Example: ls -l (To list file/directory permissions and file sizes) Example: ls -al /home/joey (To list all files and permissions in /home/joey) For more information, in a terminal, type man ls
How do I delete files?
To delete a file you must first have write permission to it. For information about permissions, click here. Once you have write permission, in a terminal run: rm filename
How do I delete directories?
If you have ownership to the directory and the directory is empty, you can simply type rmdir directoryname to remove the directory. If the directory is not empty and you wish to simply delete it and all its contents, run rm -rf directoryname Please be careful with the -rf flag, as it will remove everything in the specified directory including sub directories. With root access and the rm -rf command you can wipe out your entire system if you make an error.
How do I access my cdrom drive?
Linux requires you to mount your cdrom/floppy drives when you wish to use them. On most Linux distributions, the mount command will require root access. Depending on which Linux distribution you run, one of the following commands should mount your cdrom drive. As root, run: mount /dev/cdrom /mnt/cdrom mount /dev/cdrom /cdrom
How do I access my floppy drive?
Linux requires you to mount your cdrom/floppy drives when you wish to use them. On most Linux distributions, the mount command will require root access. Depending on which Linux distribution you run, one of the following commands should mount your floppy drive. As root, run: mount /dev/fd0 /mnt/floppy mount /dev/fd0 /floppy
How do I view/change ownership on files/directories?
One of the great features of Linux is that it is a multi-user system. With multi-users, it allows certain users to own files and directories so nobody else can access/modify them, for example your /home directory. To change the ownership of a file/directory, as root execute the following command in a terminal: chown username. filename/directory This will change the ownership and group ownership of the specified file or directory to the specified user. For more information, in a terminal, type man chown
How do I view/change permissions on files/directories?
There are 3 different attributes a file can have that make up the permissions for the file. There is read access that allows users to read the file. There is write access that allows users to modify the file. There is executable access that allows users to execute the file.
From these three attributes, you now have three different levels of permissions, the first being for the owner of the file, the second being for the group the file belongs to and the third being all other users on the system.
To view the current permissions on files and directories run the following command: ls -l and you should see something that looks like:
drwxrwxr-x 3 joey html 4096 Sep 12 2000 images/ -rw-rw-r-- 1 joey html 267 Aug 8 12:55 index.shtml
The above shows you that images is a directory (d) and that the owner and group (joey html) have read (r), write (w) and execute (x) permissions while other users on the system only have read (r) and execute (x) permissions.
To modify the permissions on a file, you either have to own it or be logged in as root. To modify the permissions, in a terminal type: chmod xxx filename/directory You will have to replace the xxx flags with the permissions you wish to change. You can either go by the numerical value or by the actuals.
Some common numerical values are: 755 - Read, Write, Execute for owner, read, execute for group and other. 644 - Read, Write for owner, read for group and other. 666 - Read, Write for all. 700 - Read, Write, Execute for owner, nothing for group, other.
So if you wanted to make a file an executable for your user and other users on the system, you would run the following:
chmod 755 somefile
For more information, in a terminal, type man chmod
How do I find files on my system?
There are two methods to search for files on your Linux machine, one method being the locate command and the other being the find command. If you wish to use the locate command, you must first update the locate database by running the following command in a terminal as root: /usr/bin/updatedb This will create an index of all the files and their locations on your hard drive. Once updatedb has completed running, you may now search your drive for a specific file by running the following command in a terminal: /usr/bin/locate filename
Another way to search your linux system is with the find command. To find a file on your sytem with the find command, in a terminal run the follwoing: /usr/bin/find / -name filename Be sure to replace "filename" with the actual name of the file.
How do I unzip a .tar.gz/.tgz file?
To extract .tar.gz or .tgz files, run the following command in a terminal: tar -zxvf file.tar.gz (or file.tgz) This will normally create a new directory based on the filename. If you want to extract a filename called file.tar (without the .gz) simply run: tar -xvf file.tar For more information, in a terminal, type man tar
How do I unzip a .bz2 file?
To extract .bz2 files, run the following command in a terminal: bunzip2 -dv file.bz2 This will normally create a new directory based on the filename. For more information, in a terminal, type man buznip2
How do I install a program?
There are many ways to install applications in Linux. If the file you wish to install is in .rpm format and you are running an RPM based distribution such as Red Hat, Mandrake or SuSE, run the following command as root in a shell prompt/terminal: rpm -Uvh filename.rpm
If you are running Debian GNU/Linux and you wish to install a .deb file, you can do so by running the following command in a terminal as root: dpkg -i filename.deb or apt-get install package (if you have APT already installed/configured).
If the file you with to install is in a .tar.gz, .tgz or .bz2 format, you will first have to decompress (unzip) the file. Once the file has been unziped, it should create a directory based on the filename. Simply change into that directory and open up the README or INSTALL file in a text editor and follow the installation instructions.
ITALIANO:
Come riavvio la mia macchina?
Per riavviare la vostra macchina, dovete dare le istruzioni al kernel Linux di arrestare tutti i processi (programmi) che stanno girando sul sistema. E' sbagliato premere il tasto di reboot sulla parte anteriore del vostro computer, poichè Linux deve essere spento/riavviato correttamente. Autenticatevi come root su un terminale e digitare uno dei seguenti comandi:
- reboot
- shutdown -r now
- init 6
Come Spengo la mia macchina?
Per spegnere la vostra macchina, dovete dare le istruzioni al kernel Linux di arrestare tutti i processi (programmi) che stanno girando sul sistema. E' sbagliato premere il tasto l'alimentazione sulla parte anteriore del vostro computer, poichè Linux deve essere spento/riavviato correttamente. Autenticatevi come root su un terminale e digitare uno dei seguenti comandi:
- halt
- shutdown -h now
- init 0
Come rimuovere/disinstallare LiLo/Grub?
Se desiderate rimuovere Lilo o eliminare qualsiasi altro boot loader dal vostro sistema (se desideraste disinstallare linux ecc.) seguite le procedure di seguito elencate: Per Windows 95/98 e ME: Usare un disco di boot del sistema ed al promt dei comandi digitare: fdisk /mbr Per Windows XP: Avviare il sistema con il cd d'installazione di XP ed entrare in modalità di ripristino. Digitare quindi il comando: fixmbr
Come aggiungo un utente?
Una volta loggati come root, al prompt della shell digitare il comando adduser username, sostituendo ad username il nome che dovete dare al nouvo utente. Potete creare quanti utenti vorrete, anche uno per ogni membro della vostra famiglia, ad esempio.
Come cancello un utente?
Una volta loggati come root, al prompt della shell digitare il comando userdel username, sostituendo ad username il nome dell'utente desiderate cancellare.
Come cambio la mia password d'accesso?
Per settare la password d'accesso per un utente specifico, al promt della shell (loggati da root) digitare passwd username, sostituendo ad username il nome di login della persona con la password da cambiare. Scrivendo il comando passwd soltanto potrete cambiare la password dell'utente sotto il quale vi siete loggati. Non usare parole d'accesso che siano facili da indovinare, come ad esempio il vostro nome o il nome di animali domestici.
Come copio i file?
cp - Viene usato per copiare files/directories da una posizione all'altra Modo d'uso: cp file posizione Esempio: cp /home/joey/index.html /var/www/index.html Esempio: cp /home/joey/* /var/www/ (con questo comando si copia la directories /home/joey su /var/www/) Per Ulteriori informazioni, da un terminale digitare man cp.
Come Rinomino/sposto i file?
mv - Viene usato per spostare o rinominare files Modo d'uso: mv file percorso (per spostare) Modo d'uso: mv nomefile nuovonomefile (per rinominare) Esempio: mv index.html /var/www/index.html (per spostare) Esempio: mv index.html index2.html (per rinominare) Per Ulteriori informazioni, da un terminale digitare man mv
Come ottengo l'indice delle directory?
ls - Elenca il contenuto di una directory Modo d'uso: ls [opzione] directory Esempio: ls (per vedere il contenuto della directory corrente) Esempio: ls -a (per vedere anche i file nascosti) Esempio: ls -l (per elencare anche i permessi ed i formati di file/directory) Esempio: la - al /home/joey (per vedere la lista dei file con i relativi permessi in /home/joey) Per Ulteriori informazioni, da un terminale digitare man ls.
Come cancello i file?
Per cancellare un file che dovete in primo luogo avere il permesso di scrittura su di esso. Per le informazioni sui permessi, vedere di seguito. Una volta che avete il permesso di scrittura su un file, da un terminale digitare: rm nomefile
Come cancello le directory?
Se avete i permessi e la directory è vuota, per cancellare una directory, basta digitare rmdir nomedirectory. Se la directory non è vuota e desiderate cancellare essa e tutto il contenuto, digitare il comando rm -rf nomedirectory. Fate attenzione all'opzione -rf, poichè rimuoverà tutta la directory specificata compreso le directory secondarie. Con il comando rm -rf con un errore potete eliminare il vostro intero sistema.
Come accedo al mio cdrom?
Linux richiede il montaggio dei vostri dispositivi cdrom/floppy nel momento in cui desiderate usarli. Sulla maggior parte delle distribuzioni Linux, il comando di montaggio richiederà l'accesso da root. Secondo quale distribuzione Linux usate, uno di seguenti comandi dovrebbe montare il vostro dispositivo cdrom. Da root, la sintassi è: mount /dev/cdrom /mnt/cdrom mount /dev/cdrom /cdrom
Come accedo al mio floppy?
Linux richiede il montaggio dei vostri dispositivi cdrom/floppy nel momento in cui desiderate usarli. Sulla maggior parte delle distribuzioni Linux, il comando di montaggio richiederà l'accesso da root. Secondo quale distribuzione Linux usate, uno di seguenti comandi dovrebbe montare il vostro dispositivo floppy. Da root, la sintassi è: mount /dev/fd0 /mnt/floppy mount /dev/fd0 /floppy
Come vedo/cambio le proprietà di files/directories?
Una delle maggiori caratteristiche di Linux è quella di essere un sistema multi-utente. Con più utenti, bisogna tenere al sicuro i propri file e directory in modo che nessuno altro vi possa accedere/modificare, un esempio potrebbe essere la vostra directory /home.Per cambiare la proprietà di un file/directory, da root, su di un terminale, eseguire il seguente comando: chown username. nomefile/directory Con questo comando cambierà la proprietà per l'utente e per il gruppo indicato sul file o directory specificata . Per Ulteriori informazioni, da un terminale digitare man chown.
Come vedo/cambio i permessi di files/directories?
Ci sono 3 attributi differenti che un file può avere e compongono i permessi sul file. Vi è l'attributo di accesso a lettura che permette agli utenti di leggere il file. L'attributo di accesso a scrittura che permette agli utentidi modificare il file. L'attributo di accesso ad esecuzione consente agli utenti di eseguire il file. Da questi tre attributi, si hanno tre livelli differenti di permessi, il primo per il proprietario del file, il secondo per il gruppo a cui il file appartiene a ed il terzo per tutti gli altri utenti sul sistema.Per vedere i permessi su file e directory seguire i seguenti comandi: ls -l e dovreste vedere qualcosa di simile:
drwxrwxr-x 3 joey html 4096 Sep 12 2000 images/ -rw-rw-r-- 1 joey html 267 Aug 8 12:55 index.shtml
Le opzioni che potete vedere partendo da sinistra stanno ad indicare che è una directory (d la prima lettera), i permessi per il proprietario (i prime 3 caratteri dopo d) poi quelli per il gruppo (i secondi tre)ed infine per tutti gli utenti(gli ultimi tre)si può avere il permesso a lettura (r), a scrittura (w) ed esecuzione(x), il file sopra indicato perciò avrà permesso a lettura e scrittura per il proprietario e per il gruppo e soltanto il permesso di lettura per tutti gli altri utenti.
Per poter modificare i permessi su un file, dovrete esserne il proprietario o essere loggati come root. Per modificare i permessi, da un termnale: chmod xxx nomefile/directory dovrete sostituire le xxx con i permessi che desiderate cambiare. potete scrivere valori numerici a seconda dello specchietto che vi riportiamo di seguito:
755 - Lettura, scrittura, esecuzione per il proprietario, lettura, esecuzione per il gruppo ed altri utenti. 644 - Lettura, scrittura per il proprietario, lettura per il gruppo ed altri utenti. 666 - Lettura e scrittura per tutti. 700 - Lettura, scrittura, esecuzione per il proprietario, nessun permesso per il gruppo ed altri. Se desideraste rendere un file eseguibile per il vostro ed altri utenti del sistema, digitate quanto segue:
chmod 755 nomefile Per Ulteriori informazioni, da un terminale digitare man chmod.
Come trovo i file sul mio sistema?
Ci sono due metodi per cercare file sul vostro sistema Linux, un modo è per ordine di posizionamento l'altro è perordine di ritrovamento. Se desiderate utilizzare l'ordine di posizionamento, dovete in primo luogo aggiornare la base dei dati di posizionamento digitando il seguente comando da root: /usr/bin/updatedb
Questo comando genererà un indice di tutti i file con la relativa posizione sul vostro hard disc. Una volta che il updatedb ha completato la procedura, potete cercare il vostro file specifico digitando da terminale il seguente comando: /usr/bin/locate nomefile
Un altro metodo di ricerca sul vostro sitema è per ordine di ritrovamento. Per trovare un file sul vostro sistema con il suddetto metodo, in un terminale eseguite quanto segue: /usr/bin/find / -name nomefile Sostituire "nomefile" con il nome reale del file.
Come decomprimo un file .tar.gz/.tgz?
Per estrarre file .tgz o .tar.gz, in un terminale eseguire quanto segue: tar -zxvf file.tar.gz (o file.tgz) Ciò genererà normalmente una nova directory con il nome dell'archivio. Se desiderate estrarre un file con estenzione .tar (senza il gz) digitare semplicemente: tar -xvf file.tar Per Ulteriori informazioni, da un terminale digitare man tar.
Come deconmprimo un file .bz2?
Per estrarre file .bz2, da un terminale eseguire: bunzip2 -dv file.bz2 Ciò genererà una nuova directory con il nome dell'archivio. Per Ulteriori informazioni, da un terminale digitare man buznip2.
Come installo un programma?
Ci sono molti modi per installare programmi sotto Linux. Se il file che desiderate installare è disponibile in formato rpm ed avete una distribuzione basata su RPM come Red Hat, Mandrake o SuSE, su di un terminale da root digitare: rpm -Uvh filename.rpm
Se avete una distribuzione Debian GNU/Linux e desiderate installare una file .deb, digitate da root su dui un terminale quanto segue:
dpkg -i nomefile.deb o apt-get install pacchetto (se avete APT correttamente installato/configurato)
Se il file da installare è disponibile su di un archivio .tar.gz, .tgz o .bz2, dovrete prima di tutto decomprimere il file. Una volta che il file è stato scompattato, troverete una directory con il nome dell'archivio. Entrate nella directory appena create ed aprite il file README o INSTALL con un editor di testi e seguite le istruzioni per l'installazione.

