Linux Tutorial – Puntata 13

di jolek78

Care/i fruitrici e fruitori del blog, in questi post – ogni domenica mattina – si parlerà del sistema operativo GNU/Linux e degli strumenti per utilizzarlo al massimo delle potenzialità. Cercheremo di spiegare come funziona, cosa è il kernel, come costruirsi una vpn, come settare un firewall e giocare col terminale, usare adb e altro. Se il capitalismo della sorveglianza ci vuole passivi consumatori-consumatrici di servizi noi si risponde con un po’ di “cultura informatica” e un MARAMEO (quasi affettuoso). Buona lettura!

Dunque, eccoci qui ancora una volta a esplorare il FHS – filesystem hierarchy standard – presente nella nostra macchina virtuale. Questa volta è il momento della nostra /HOME dir, cioè la casa del nostro utente dove abbiamo i completi permessi di lettura e scrittura, dove abbiamo i file di configurazione delle nostre applicazioni, e dove possiamo collocare i nostri file, dove abbiamo il file della nostra shell. È in sostanza, se non vorrete diventare “amministratori” del vostro sistema ma soltanto “utilizzatori”, l’unico posto a cui, normalmente, farete riferimento. Una piccola aggiunta prima di cominciare: ho deciso di aggiungere una puntata 0 a questo tutorial, una sorta d’indice, dove poter trovare elencate tutte le puntate in sequenza. Magari alla fine sarà disponibile anche un glossario ma non è questo il momento per parlare del futuro… Cominciamo:

/HOME

Innanzi tutto le basi. Per avere accesso alla vostra /home directory, bastera’ semplicemente:

bottega@bottegadelbarbieri  /  cd ~
bottega@bottegadelbarbieri  ~  pwd
/home/bottega

Il simbolo ~ (tilde) dopo il comando cd (change directory) assicura che noi ci muoveremo direttamente nella nostra /home, che nel caso del nostro utente sara’

/home/bottega

Ora proviamo prima a listare il contenuto con un metodo standard

bottega@bottegadelbarbieri  ~  ls -l
total 1048728
drwxr-xr-x 2 bottega bottega 4096 Feb 27 09:10 Desktop
drwxr-xr-x 2 bottega bottega 4096 Feb 27 09:10 Documents
drwxr-xr-x 2 bottega bottega 4096 Feb 28 12:28 Downloads
drwxr-xr-x 2 bottega bottega 4096 Feb 27 09:10 Music
drwxrwxr-x 2 bottega bottega 4096 May 9 00:41 output
drwxr-xr-x 2 bottega bottega 4096 Feb 27 09:31 Pictures
drwxr-xr-x 2 bottega bottega 4096 Feb 27 09:10 Public
-rw-rw-r-- 1 bottega bottega 1073741824 Mar 9 23:35 random.file
-rwxrwxr-x 1 bottega bottega 72 May 16 00:20 script-std.sh
-rw-rw-r-- 1 bottega bottega 1073741824 Mar 10 00:12 sparse.file
drwxr-xr-x 2 bottega bottega 4096 Feb 27 09:10 Templates
-rw-rw-r-- 1 bottega bottega 51705 May 16 02:14 test-err.txt
-rw-rw-r-- 1 bottega bottega 1111 May 16 03:06 test-out.txt
-rw-rw-r-- 1 bottega bottega 34 May 16 03:05 test.txt
-rw-rw-r-- 1 bottega bottega 20276 May 16 03:41 the-rhyme-mariner-in.txt
-rw-rw-r-- 1 bottega bottega 20272 May 16 03:02 the-rhyme-mariner.txt
drwxrwxr-x 2 bottega bottega 4096 Apr 25 06:17 tmp
drwxr-xr-x 2 bottega bottega 4096 Feb 27 09:10 Videos

Guardate ora la prima colonna da sinistra. Quali sono i file e quali sono le directory? Cercherò di rappresentarlo prima con una tabella con qualche esempio, ma poi ci torneremo su nella puntata in cui tratteremo chmod, chown e chgrp:

Nome File Tipologia File Permessi x Utente Permessi x Gruppo Permessi x Tutti
Desktop d
directory
rwx
lettura
scrittura
esecuzione
r-x
lettura
esecuzione
r-x
lettura
esecuzione
random.file
file
rw
lettura
scrittura
rw-
lettura
scrittura
r–
lettura
script-std.sh
file
rwx
lettura
scrittura
esecuzione
rwx
lettura
scrittura
esecuzione
r-x
lettura
esecuzione

Ma c’e’ qualcosa in più. Quando proviamo a listare il contenuto della directory con un altro comando, guardate cosa succede:

bottega@bottegadelbarbieri  ~  ls -ld .*
drwxr-xr-x 22 bottega bottega 4096 May 29 11:18 .
drwxr-xr-x 4 root root 4096 Apr 29 17:29 ..
-rw------- 1 bottega bottega 13005 May 16 03:55 .bash_history
-rw-r--r-- 1 bottega bottega 220 Feb 27 08:56 .bash_logout
-rw-r--r-- 1 bottega bottega 3356 Feb 27 09:47 .bashrc
-rw-r--r-- 1 bottega bottega 3771 Feb 27 08:56 .bashrc.pre-oh-my-bash
drwxrwxr-x 12 bottega bottega 4096 May 29 11:18 .cache
drwxr-xr-x 17 bottega bottega 4096 Apr 9 02:36 .config
drwx------ 3 bottega bottega 4096 Feb 28 22:57 .dbus
-rw-r--r-- 1 bottega bottega 26 Feb 27 09:10 .dmrc
drwx------ 4 bottega bottega 4096 Feb 27 09:51 .gnupg
-rw------- 1 bottega bottega 0 Feb 27 09:10 .ICEauthority
drwxrwxr-x 3 bottega bottega 4096 Feb 27 09:10 .local
drwx------ 5 bottega bottega 4096 Feb 27 09:15 .mozilla
drwxr-xr-x 15 bottega bottega 4096 Feb 27 09:46 .oh-my-bash
-rw-r--r-- 1 bottega bottega 17 Feb 27 09:46 .osh-update
drwx------ 3 bottega bottega 4096 Feb 28 12:29 .pki
-rw-r--r-- 1 bottega bottega 807 Feb 27 08:56 .profile
-rw-r--r-- 1 bottega bottega 0 May 29 11:33 .sdirs
drwx------ 2 bottega bottega 4096 Feb 28 22:02 .ssh
-rw-r--r-- 1 bottega bottega 0 Feb 27 09:15 .sudo_as_admin_successful
-rw------- 1 bottega bottega 8222 May 16 03:16 .viminfo
drwx------ 2 bottega bottega 4096 Mar 1 08:09 .vnc
-rw------- 1 bottega bottega 462 May 29 11:18 .Xauthority
-rw-r--r-- 1 bottega bottega 1600 Feb 27 08:56 .Xdefaults
-rw-r--r-- 1 bottega bottega 14 Feb 27 08:56 .xscreensaver
-rw------- 1 bottega bottega 15624 May 29 16:29 .xsession-errors
-rw------- 1 bottega bottega 37255 May 23 03:58 .xsession-errors.old

Quei file (e directory) che cominciano con un . (dot) sono chiamati “hidden files” ovvero “file nascosti”, file cioè che non serve modificare giornalmente, ma poiché fanno parte delle vostre configurazioni personali, vanno toccati solo in caso di emergenza, e solo nel caso in cui si sappia esattamente cosa si sta facendo. Abbiamo già visto in precedenza il nostro .bashrc ovvero il file di configurazione della nostra shell.

bottega@bottegadelbarbieri  ~  cat .bashrc |head 
# Path to your oh-my-bash installation.
export OSH=/home/bottega/.oh-my-bash

# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-bash is loaded.
OSH_THEME="agnoster"

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

Oppure, andando a visualizzare la directory .mozilla, vedremo che conterrà tutte le configurazioni necessarie a far andare il nostro profilo personale di mozilla firefox

bottega@bottegadelbarbieri  ~  ls -ltr .mozilla/
total 12
drwx------ 6 bottega bottega 4096 Feb 27 09:15 firefox
drwx------ 2 bottega bottega 4096 Feb 27 09:15 extensions
drwx------ 2 bottega bottega 4096 Feb 27 09:15 systemextensionsdev
bottega@bottegadelbarbieri  ~ 

E davvero per oggi basta. La /home directory e’ casa vostra. E a casa propria, ognuno ci fa quel che vuole, anche le zozzerie…

 

Alla prossima settimana!
jolek78

>> Indice <<
Puntata 12 < > Puntata 14

Il logo “Tux Linux” e’ stato realizzato e distribuito dall’artista deiby-ybied su Deviantart in licenza Creative Commons BY-NC-SA 3.0

jolek78 on Email
jolek78
Un tizio che pensava di essere uno scienziato. Si ritrovò divulgatore scientifico. Poi si addormentò su un aereo e si risvegliò informatico. Ma era sempre lui.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *