Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Sistemi operativi I > Preparazione per la prova di laboratorio
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Guccio
.fedelissimo.

User info:
Registered: May 2009
Posts: 59 (0.01 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 9:28:59 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Unhappy Preparazione per la prova di laboratorio

scusate raga in questo esercizio : Trovare l'utente col minor numero di file nel sistema

io ho fatto in questo modo:

#! /bin/sh

indice=0
listaCut=$(cut -f 3 -d : /etc/passwd)
for USER in $listaCut; do
cont[$[{indice}]=0
listaFind=$(find / -user "${USER}" -type -f)
indiceTemp=0
for FILE in listaFind; do
cont[${indice}]=$(expr ${indiceTemp} + 1)
done
cat /etc/passwd | grep "$USER"
echo "--------"
echo "$cont[${indice}]"
indice=$(expr ${indice} + 1)
done

L'ordinamento me lo volevo tenere per dopo, volevo vedere prima se funzionava

Ma l'output di minix è:

cont[0]=0: no such file or directory
./primo.sh: Out of space

Dove ho sbagliato?

17-06-2010 22:12
Click Here to See the Profile for Guccio Click here to Send Guccio a Private Message Find more posts by Guccio Add Guccio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
xSharKMaNx
un gioco della follia

User info:
Registered: Sep 2007
Posts: 1477 (0.23 al dì)
Location:
Corso: F49
Anno: Laureato
Time Online: 10 Days, 17:15:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

http://www.dsy.it/forum/showthread....&threadid=39121

vedi se può esserti di aiuto

__________________
Perché, mentre il manganello può sostituire il dialogo, le parole non perderanno mai il loro potere; perché esse sono il mezzo per giungere al significato, e per coloro che vorranno ascoltare, all'affermazione della verità. E la verità è che c'è qualcosa di terribilmente marcio in questo paese. (V)

I popoli non dovrebbero aver paura dei propri governi, sono i governi che dovrebbero aver paura dei popoli. (T.J)

18-06-2010 13:29
Click Here to See the Profile for xSharKMaNx Click here to Send xSharKMaNx a Private Message Find more posts by xSharKMaNx Add xSharKMaNx to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lordghost
Black Lord

User info:
Registered: Oct 2005
Posts: 232 (0.03 al dì)
Location: Milan
Corso: Informatica
Anno: 3
Time Online: 2 Days, 9:48:49 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ripeto la mia risposta qui:

credo che il problema sia questo:
listaFind=$(find / -user "${USER}" -type -f)

l'interprete cerca di scrivere tutti i file come:
listaFind=f1 f2 f3 f4..... f4097 --> overflow

perchè i parametri hanno un limite.

dovresti provare con il costrutto "find / | while read f; do ...$x... done;

__________________
My 3D blog: http://www.webgl.it

18-06-2010 13:37
Click Here to See the Profile for lordghost Click here to Send lordghost a Private Message Visit lordghost's homepage! Find more posts by lordghost Add lordghost to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lordghost
Black Lord

User info:
Registered: Oct 2005
Posts: 232 (0.03 al dì)
Location: Milan
Corso: Informatica
Anno: 3
Time Online: 2 Days, 9:48:49 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ho un problema con questo esercizio:

"Trovare tutti i file modificati di venerdì (sia un venerdì particolare che di venerdì in generale)"

qualcuno ha idea di come risalire alla data di modifica? Possibile che bisogna convertire il timestamp da secondi a day of the week?

__________________
My 3D blog: http://www.webgl.it

18-06-2010 13:43
Click Here to See the Profile for lordghost Click here to Send lordghost a Private Message Visit lordghost's homepage! Find more posts by lordghost Add lordghost to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Rocky
.arcimaestro.

User info:
Registered: Dec 2009
Posts: 337 (0.06 al dì)
Location:
Corso:
Anno:
Time Online: 6 Days, 0:17:10 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

stat -Mtime per la data di modifica

18-06-2010 13:53
Click Here to See the Profile for Rocky Click here to Send Rocky a Private Message Find more posts by Rocky Add Rocky to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lordghost
Black Lord

User info:
Registered: Oct 2005
Posts: 232 (0.03 al dì)
Location: Milan
Corso: Informatica
Anno: 3
Time Online: 2 Days, 9:48:49 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

grazie avevo trovato nel frattime, in modo quasi casuale. Non avevo capito che Mtime fosse diverso da mtime :D

__________________
My 3D blog: http://www.webgl.it

18-06-2010 13:57
Click Here to See the Profile for lordghost Click here to Send lordghost a Private Message Visit lordghost's homepage! Find more posts by lordghost Add lordghost to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Guccio
.fedelissimo.

User info:
Registered: May 2009
Posts: 59 (0.01 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 9:28:59 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Re: Preparazione per la prova di laboratorio

Originally posted by Guccio
scusate raga in questo esercizio : Trovare l'utente col minor numero di file nel sistema

io ho fatto in questo modo:

#! /bin/sh

indice=0
listaCut=$(cut -f 3 -d : /etc/passwd)
for USER in $listaCut; do
cont[$[{indice}]=0
listaFind=$(find / -user "${USER}" -type -f)
indiceTemp=0
for FILE in listaFind; do
cont[${indice}]=$(expr ${indiceTemp} + 1)
done
cat /etc/passwd | grep "$USER"
echo "--------"
echo "$cont[${indice}]"
indice=$(expr ${indice} + 1)
done

L'ordinamento me lo volevo tenere per dopo, volevo vedere prima se funzionava

Ma l'output di minix è:

cont[0]=0: no such file or directory
./primo.sh: Out of space

Dove ho sbagliato?


Sono arrivato ad una soluzione. E' un po' barbara ma gira :)

#! /bin/sh
if ls toOrder; then rm toOrder; fi
if ls listaCut; then rm listaCut; fi
cut -f 1,3 -d : /etc/passwd >> listaCut
echo "Calcolo in corso..."

for USER in $(cut -f 2 -d : ./listaCut); do
N=$(find / -user $USER -type f | wc -l)
echo "User $(grep $USER ./listaCut | head -1): $N files" >> toOrder
done

sort +2 -nr -t: ./toOrder | head -1

18-06-2010 18:04
Click Here to See the Profile for Guccio Click here to Send Guccio a Private Message Find more posts by Guccio Add Guccio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lordghost
Black Lord

User info:
Registered: Oct 2005
Posts: 232 (0.03 al dì)
Location: Milan
Corso: Informatica
Anno: 3
Time Online: 2 Days, 9:48:49 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Partizionamento:
come si fanno a fare 5 partizioni? Come nell'esercizio di preparazione che ci ha dato Monga. Il problema è che part ha una lista di sole 4 voci.

Oggi ho pensato di creare delle sottopartizioni, ma non so se è la soluzione giusta.

E nel caso delle sottopartizioni, nella s1 è necessario lasciare il primo cilindro libero? Ho pensato che ci memorizzasse la tabella delle sottopartizioni.

__________________
My 3D blog: http://www.webgl.it

19-06-2010 18:38
Click Here to See the Profile for lordghost Click here to Send lordghost a Private Message Visit lordghost's homepage! Find more posts by lordghost Add lordghost to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Guccio
.fedelissimo.

User info:
Registered: May 2009
Posts: 59 (0.01 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 9:28:59 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by lordghost
Partizionamento:
come si fanno a fare 5 partizioni? Come nell'esercizio di preparazione che ci ha dato Monga. Il problema è che part ha una lista di sole 4 voci.

Oggi ho pensato di creare delle sottopartizioni, ma non so se è la soluzione giusta.

E nel caso delle sottopartizioni, nella s1 è necessario lasciare il primo cilindro libero? Ho pensato che ci memorizzasse la tabella delle sottopartizioni.


Quella delle sottopartizioni è la scelta giusta. Basta lasciare un blocco libero nella prima sottopartizione

19-06-2010 19:01
Click Here to See the Profile for Guccio Click here to Send Guccio a Private Message Find more posts by Guccio Add Guccio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Guccio
.fedelissimo.

User info:
Registered: May 2009
Posts: 59 (0.01 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 9:28:59 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Domandona:
Come trovo i file di manuale? che estensione hanno?

19-06-2010 19:03
Click Here to See the Profile for Guccio Click here to Send Guccio a Private Message Find more posts by Guccio Add Guccio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Rocky
.arcimaestro.

User info:
Registered: Dec 2009
Posts: 337 (0.06 al dì)
Location:
Corso:
Anno:
Time Online: 6 Days, 0:17:10 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by lordghost
Partizionamento:
come si fanno a fare 5 partizioni? Come nell'esercizio di preparazione che ci ha dato Monga. Il problema è che part ha una lista di sole 4 voci.

Oggi ho pensato di creare delle sottopartizioni, ma non so se è la soluzione giusta.

E nel caso delle sottopartizioni, nella s1 è necessario lasciare il primo cilindro libero? Ho pensato che ci memorizzasse la tabella delle sottopartizioni.


Le partizioni primarie sono sempre 4. Occorre usare la 4 partizione come logica, se vuoi più di 4 partizioni (es. 5) per creare una tabella di sottopartizioni. Quindi non devi lasciare libero il primo cilindro di s1

19-06-2010 19:03
Click Here to See the Profile for Rocky Click here to Send Rocky a Private Message Find more posts by Rocky Add Rocky to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
franky_fs
.Vulcaniano.

User info:
Registered: May 2008
Posts: 52 (0.01 al dì)
Location: Milano
Corso: Informatica Magistrale
Anno: 2
Time Online: 2 Days, 13:42:14 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Guccio
Domandona:
Come trovo i file di manuale? che estensione hanno?


prova un bel
find / -type f | grep ".*man.*"
ti appare la lista dei file dove ci sia qualsiasi cosa che abbia la parola man... dovrebbero tutti essere in subdirectory di nome man!

__________________
Volere è potere
Memento audere semper
Sia che tu creda di farcela, o che tu creda di non farcela, hai comunque ragione!

20-06-2010 11:22
Click Here to See the Profile for franky_fs Click here to Send franky_fs a Private Message Find more posts by franky_fs Add franky_fs to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lordghost
Black Lord

User info:
Registered: Oct 2005
Posts: 232 (0.03 al dì)
Location: Milan
Corso: Informatica
Anno: 3
Time Online: 2 Days, 9:48:49 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Come si fa a creare i filesystem? mkfs mi sembra che crei solo fs di tipo minix. Ma può richiedere un altro tipo di filesystem, ho visto che tra gli esempi c'era la scelta minix/swap?

Come si crea quindi un fs swap?

__________________
My 3D blog: http://www.webgl.it

20-06-2010 17:30
Click Here to See the Profile for lordghost Click here to Send lordghost a Private Message Visit lordghost's homepage! Find more posts by lordghost Add lordghost to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 18:12.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.072 seconds (68.57% PHP - 31.43% MySQL) con 23 query.