Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
teknopedia

teknopedia

teknopedia

teknopedia

teknopedia

teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. yes (Unix) - Teknopedia
yes (Unix) - Teknopedia

yes è un comando Unix che stampa una risposta affermativa, o una stringa di testo definita dall'utente, finché non viene interrotto. Il comando fa parte delle GNU Core Utilities[1], ma non è incluso nella Single UNIX Specification.

Descrizione

[modifica | modifica wikitesto]

Il comando yes stampa ripetutamente la lettera "y", o l'eventuale stringa di testo passata come parametro, seguito da un ritorno a capo, finché non viene fermato dall'utente o ucciso in altro modo. Se rediretto su un altro comando continua finché la pipe non viene interrotta (e quindi quando l'esecuzione del programma è completata).

Può anche essere usato per testare il comportamento di un sistema sotto carico, in quanto yes, sui sistemi monoprocessore, usa il 100% della CPU (nei sistemi multiprocessore per ottenere lo stesso risultato è necessario lanciare un processo per ogni CPU).

Uso

[modifica | modifica wikitesto]

Alcuni programmi Unix se invocati da riga di comando per procedere chiedono all'utente di rispondere di sì con una y (o di no, con una n).[2] Nel suo uso più classico, yes permette di utilizzare tali programmi in maniera non interattiva, dandogli automaticamente una risposta affermativa (o negativa, usando yes n).

Questo spesso oggi non è più necessario, in quanto molti comandi che richiedono risposte dall'utente prevedono alternativamente un'opzione force (come rm -f)[2] o hanno un'opzione assume-yes (come apt-get -y).

Ad esempio, il seguente comando: rm -f *.txt

è funzionalmente equivalente a: yes | rm *.txt

Assieme al comando head, yes può essere usato per generare file voluminosi a scopo di test. Ad esempio, l'esecuzione di: yes 1234567 | head -1000 > file

produce un file di 1000 righe, ognuna delle quali formata da otto caratteri (1, 2, 3, 4, 5, 6, 7 e un ritorno a capo).

Note

[modifica | modifica wikitesto]
  1. ↑ (EN) yes: Print a string until interrupted in info coreutils
  2. 1 2 (EN) rm su The Single UNIX Specification, Version 2

Collegamenti esterni

[modifica | modifica wikitesto]
  • (EN) Pagina di manuale di yes (versione GNU)
  • (EN) Pagina di manuale di yes (versione BSD)
V · D · M
Programmi Unix/Unix-like con interfaccia a riga di comando e comandi interni della shell unix
File systemcat · cd · chattr · chmod · chown · chgrp · cksum · cmp · cp · du · df · fdisk · file · fsck · fuser · gzip · ln · ls · lsattr · lsof · mkdir · mknod · mount · mv · pwd · rm · rmdir · split · tar · touch · umount · umask
Processiat · chroot · crontab · exit · kill · killall · nice · nohup · pgrep · pidof · pkill · ps · pstree · sleep · time · top · wait
Ambiente utentealias · env · export · finger · id · logname · mesg · newgrp · passwd · su · sudo · uname · uptime · w · wall · who · whoami · write
Elaborazione testoawk · comm · cut · diff · ed · ex · fmt · head · iconv · join · less · more · paste · sed · sort · tail · tr · uniq · vi · wc · xargs
Script di shellbasename · dirname · echo · expr · false · printf · test · true · unset
Retedig · nslookup · ifconfig · netstat · ping · rcp · rlogin · route · netcat · traceroute
Ricerchefind · grep · strings
Amministrazionedmesg · groupadd · groupdel · groupmod · mdadm · shutdown · useradd · userdel · usermod
Altribanner · bc · cal · clear · date · dd · lp · man · size · tee · tput · yes
  Portale Informatica: accedi alle voci di Teknopedia che trattano di informatica
Estratto da "https://it.wikipedia.org/w/index.php?title=Yes_(Unix)&oldid=130412766"

  • Indonesia
  • English
  • Français
  • 日本語
  • Deutsch
  • Italiano
  • Español
  • Русский
  • فارسی
  • Polski
  • 中文
  • Nederlands
  • Português
  • العربية
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022