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 > Esame di laboratorio (Giugno 2007) - Domande Thread Rating: 3 votes, 5.00 average.
Pages (39): « First ... « 20 21 22 23 [24] 25 26 27 28 » ... Last »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
picchio
.primate.

User info:
Registered: Dec 2007
Posts: 67 (0.01 al dì)
Location:
Corso: informatica
Anno:
Time Online: 15:46:09: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Tastiera italiana nella prova lab

Scusate la domanda forse scontata.
Vorrei sapere se durante la prova di laboratorio i PC hanno
già impostata la tastiera italiana o dobbiamo impostarcela noi.
Grazie

22-07-2008 14:57
Click Here to See the Profile for picchio Click here to Send picchio a Private Message Find more posts by picchio Add picchio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Joliet Jake
.illuminato.

User info:
Registered: Oct 2006
Posts: 249 (0.04 al dì)
Location: Milano
Corso: Informatica triennale
Anno: 3
Time Online: 1 Day, 4:31:25 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Scusate la domanda forse scontata.
Vorrei sapere se durante la prova di laboratorio i PC hanno
già impostata la tastiera italiana o dobbiamo impostarcela noi.
Grazie

quando l'ho fatto io era in italiano

--------------------------------
scusate io sto facendo gli esercizi sulle schede.. ora prendiamo per esempio quello di trovare la somma delle occupazioni dei file di un utente.

#!/bin/sh
if [ $# -ne 1 ]; then
echo "syntax: user_size <user_name>"
exit 1
fi
ID="$(grep "^$1" /etc/passwd | cut -f 3 -d :)"
if [ "$ID" = "" ]; then
echo "User \"${1}\" not found"
exit 1
fi
echo "calculating..."
SUM=0
for ITEM in $(find / -user "$ID" -type f | xargs du | cut -f 1); do
SUM=$(expr ${SUM} + ${ITEM})
done
echo "User \"${1}\" takes ${SUM} KB into the system"
exit 0


questo lo sappiamo grazie a n3o, ora vorrei tanto sapere

  1. ma noi dovremmo sfornare robe del genere li senza sapere nulla di nulla?
  2. quanto cacchio di tempo abbiamo per creare questi mostri?
  3. ma voi la sapete fare una cosa del genere o sono solo io il ritardato cher non ci riuscirebbe mai?
  4. voi che avete fatto per prepararvi avetre letto le schede e basta? avete guardato altri manuali, quelli indicati sulla wiki di laboratorio?


io devo passare questo cacchio di esame, possibile che sia così complicato? mi basta passare la parte di partizione e quella di shell.. la parte di shell è così complicata porca miseria? mi viene da piangere.

rimetto assieme tutte le domande dell'ultima lezione di laboratorio sulla shell cioè la quinta:

  1. trovare il file più grosso in un certo ramo
  2. copiare files da un ramo ad un altro mantenendo intatta la struttura delle directory
  3. Calcolare lo spazio occupato dai file di proprieta di un
    certo utente
  4. Scrivere un comando che conta quanti fi le ci sono in un
    determinato ramo del fi lesystem
  5. Aggiungere 10 utenti prendendo la lista da un file di testo
  6. Creare un archivio tar.gz contenente tutti i fi le la cui
    dimensione è minore di 50KB
  7. Rinominare un certo numero di file: per esempio tutti i fi le
    .png in .jpg
  8. Creare un file da 10MB costituito da caratteri casuali
    (usando /dev/random) e veri ficare se contiene la parola
    MINIX
  9. Trovare l'utente che ha il maggior numero di file nel
    sistema
  10. Trovare i 3 utenti che, sommando la dimensione dei loro
    file, occupano piu` spazio nel sistema.

__________________
In Blues We Trust

Last edited by Joliet Jake on 22-07-2008 at 16:46

22-07-2008 15:56
Click Here to See the Profile for Joliet Jake Click here to Send Joliet Jake a Private Message Visit Joliet Jake's homepage! Find more posts by Joliet Jake Add Joliet Jake to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Joliet Jake
.illuminato.

User info:
Registered: Oct 2006
Posts: 249 (0.04 al dì)
Location: Milano
Corso: Informatica triennale
Anno: 3
Time Online: 1 Day, 4:31:25 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
soluzioni

allora in attesa che qualcuno mi dica se sono condannato o no cerco le soluzioni ai quesiti che ho postato sopra:

1)

trovare il file più grosso in un certo ramo


find directory -type f | xargs du | sort -n | tail -n 1

(grazie n30)

2)
copiare files da un ramo ad un altro mantenendo intatta la struttura delle directory


cp -rp /directory/albero1/* /directory/albero2

(grazie n30)

3)
Calcolare lo spazio occupato dai file di proprieta di un certo utente


SUM=0
for ITEM in $(find / -user "utente" -type f | xargs du | cut -f 1); do
SUM=$(expr ${SUM} + ${ITEM})
done
echo "${SUM} KB"

(grazie n30)

4)
Scrivere un comando che conta quanti fi le ci sono in un
determinato ramo del fi lesystem


find dir -type f | xargs du | wc -l

5)
Aggiungere 10 utenti prendendo la lista da un file di testo


Creato un file di nome utenti di questo tipo:

u0 other /usr/u0
.....ecc fino a u9

cat utenti | while read i; do adduser $i; done

6)
Creare un archivio tar.gz contenente tutti i fi le la cui
dimensione è minore di 50KB

find / -type f -size -50 -exec tar cvf archivio.tar {} \;
---------------
EDITERO' QUESTO POST MAN MANO CHE TROVO LE SOLUZIONI/CI ARRIVO

__________________
In Blues We Trust

Last edited by Joliet Jake on 23-07-2008 at 16:16

22-07-2008 16:30
Click Here to See the Profile for Joliet Jake Click here to Send Joliet Jake a Private Message Visit Joliet Jake's homepage! Find more posts by Joliet Jake Add Joliet Jake to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ste182
.arcimaestro.

User info:
Registered: Oct 2004
Posts: 258 (0.03 al dì)
Location:
Corso: informatica
Anno:
Time Online: 2 Days, 5:06:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ma io non capisco a cosa serve mettere
!/bin/sh per gli script

se lo scrivo io mi da errore "no such file or directory"




----

no niente scusate... ho scritto una cazzata..ho capito da solo ahahah

__________________
Live Fast, Die Fun

Last edited by ste182 on 22-07-2008 at 16:50

22-07-2008 16:36
Click Here to See the Profile for ste182 Click here to Send ste182 a Private Message Find more posts by ste182 Add ste182 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ti da errore perchè manca un cancelletto
la riga giusta è #!/bin/sh
serve per fare uno script nell'editor e poi farlo girare direttamente....

22-07-2008 17:27
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gehur
.grande:maestro.

User info:
Registered: Apr 2006
Posts: 519 (0.08 al dì)
Location: Milano
Corso: Informatica
Anno:
Time Online: 3 Days, 0:41:42 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

o ma ragazzi perchè se scrivo

find / -type f -size -20| xargs tar cvf archivio.tar

mi dice cannot open archivio.tar..

e poi come cavolo funziona il comando ar non riesco propio a farlo andare..

PS
ho risolto in questa maniera

find / -type f -size -20 -exec tar cvf archivio.tar {} \;

se metto ar però non mi va..

find / -type f -size -20 -exec ar c archivio.a {} \;

Last edited by Gehur on 23-07-2008 at 10:56

23-07-2008 10:48
Click Here to See the Profile for Gehur Click here to Send Gehur a Private Message Find more posts by Gehur Add Gehur to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
darkshadow
Are You From The Past?

User info:
Registered: Jul 2007
Posts: 485 (0.08 al dì)
Location: Milano
Corso: Informatica Magistrale
Anno: 1
Time Online: 13 Days, 13:38:56 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

 
credo perchè devi passare a tar ulteriori parametri perchè non penso ti crei di default un archivio tar magari se solo li passi il nome dell'archivio cerca di aprirlo. guarda il man di tar cmq ti consiglio di vedere anche ar perchè negli ultimi esami di lab chiedeva di archiviarli con ar

__________________
by Ð@rk§h@ÐØw

Last edited by darkshadow on 23-07-2008 at 11:07

23-07-2008 10:57
Click Here to See the Profile for darkshadow Click here to Send darkshadow a Private Message Find more posts by darkshadow Add darkshadow to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Joliet Jake
.illuminato.

User info:
Registered: Oct 2006
Posts: 249 (0.04 al dì)
Location: Milano
Corso: Informatica triennale
Anno: 3
Time Online: 1 Day, 4:31:25 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Aggiungere 10 utenti prendendo la lista da un file di testo


questa si fa così

cut -f 1 file | xargs adduser {} gruppo /usr/{}

?

__________________
In Blues We Trust

23-07-2008 12:40
Click Here to See the Profile for Joliet Jake Click here to Send Joliet Jake a Private Message Visit Joliet Jake's homepage! Find more posts by Joliet Jake Add Joliet Jake to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Deky
.fedelissimo.

User info:
Registered: Feb 2007
Posts: 53 (0.01 al dì)
Location:
Corso: informatica
Anno:
Time Online: 20:50:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

raga...mi avete abbuffato a rispondere su sto ca**o di post....ne potete aprire uno nuovo??? che mi continuano ad arrivare le mail :D :D

ciau

23-07-2008 12:41
Click Here to See the Profile for Deky Click here to Send Deky a Private Message Find more posts by Deky Add Deky to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
GiaXVI
.........................

User info:
Registered: Oct 2005
Posts: 86 (0.01 al dì)
Location: settimo milanese
Corso: informatica
Anno: 2
Time Online: 21:45:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

spunta la check babbo!!!!!!!!!!!!!!!! fai informatica o agraria??

23-07-2008 12:50
Click Here to See the Profile for GiaXVI Click here to Send GiaXVI a Private Message Find more posts by GiaXVI Add GiaXVI to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gehur
.grande:maestro.

User info:
Registered: Apr 2006
Posts: 519 (0.08 al dì)
Location: Milano
Corso: Informatica
Anno:
Time Online: 3 Days, 0:41:42 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

haha risposta corretta, modo forse un po violento :D

Last edited by Gehur on 23-07-2008 at 14:05

23-07-2008 13:46
Click Here to See the Profile for Gehur Click here to Send Gehur a Private Message Find more posts by Gehur Add Gehur to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ste182
.arcimaestro.

User info:
Registered: Oct 2004
Posts: 258 (0.03 al dì)
Location:
Corso: informatica
Anno:
Time Online: 2 Days, 5:06:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by jeremy.1983
ma perEsame.qcow è quello che si usa fisicamente all'esame, giusto?

Per me è meglio, io ho praticamente sempre usato solo quello. Però è vero ho notato parecchi errori col for. Adesso provo a riscrivere i miei script col while

Dengh'iu


io non riesco a farla andare l'immagine perEsame.qcow ... la lancio da qemu facendo:
qemu -hda perEsame.qcow parte minix e si blocca alla schermata del dump dei registri e i processi... poi non va più avanti

__________________
Live Fast, Die Fun

23-07-2008 18:14
Click Here to See the Profile for ste182 Click here to Send ste182 a Private Message Find more posts by ste182 Add ste182 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ste182
.arcimaestro.

User info:
Registered: Oct 2004
Posts: 258 (0.03 al dì)
Location:
Corso: informatica
Anno:
Time Online: 2 Days, 5:06:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

- calcolare lo spazio occupato da un utente (dai suoi files)

ho modificato lo script per calcolare lo spazio occupato da OGNI utente sul sistema.. sembra funzionare per un pò, dopo comincia a dire "out of space".. sapete dirmi perchè?
il codice è questo:

#!/bin/sh
sum=0
for id in $(cut /etc/passwd -d : -f 3); do
for item in $(find / -type f -user $id | xargs du | cut -f 1); do
sum=$(expr $sum + $item)
done
echo "dim. tot. dei files di utente $id: $sum Kb"
dome

__________________
Live Fast, Die Fun

23-07-2008 18:34
Click Here to See the Profile for ste182 Click here to Send ste182 a Private Message Find more posts by ste182 Add ste182 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gehur
.grande:maestro.

User info:
Registered: Apr 2006
Posts: 519 (0.08 al dì)
Location: Milano
Corso: Informatica
Anno:
Time Online: 3 Days, 0:41:42 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

anche a me a volte escono sti errori e per quanto mi riguarda non mi interesso per il semplice fatto che lo script è scritto in maniera corretta quindi do la colpa al fatto si usare la macchina virtuale con ste immagini prese dal wiki..


spero di non pentirmene domani :D

Last edited by Gehur on 23-07-2008 at 19:56

23-07-2008 19:34
Click Here to See the Profile for Gehur Click here to Send Gehur a Private Message Find more posts by Gehur Add Gehur to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
jaguaro
.consigliere.

User info:
Registered: Jun 2006
Posts: 108 (0.02 al dì)
Location: Milano
Corso: STCM
Anno:
Time Online: 11:05:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

scusa ma....


Scrivere un comando che conta quanti fi le ci sono in un
determinato ramo del fi lesystem


find dir -type f | xargs du | wc -l


questa soluzione funziona ma è uno spreco di risorse..
il du non serve, devi solo calcolare quanti file sono..
per cui io farei
code:
find dir -type f | wc -w

__________________
Carlo Boni
Rappresentante Studenti
Sinistra Universitaria

23-07-2008 21:56
Click Here to See the Profile for jaguaro Click here to Send jaguaro a Private Message Visit jaguaro's homepage! Find more posts by jaguaro Add jaguaro to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 13:02.    Post New Thread    Post A Reply
Pages (39): « First ... « 20 21 22 23 [24] 25 26 27 28 » ... Last »   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.048 seconds (79.89% PHP - 20.11% MySQL) con 26 query.