סקונילב םיוות ,םילימ ,תורוש רפסמ תריפסל WC תדוקפל תואמגוד 6


.ןלהל גצומכ wc הדוקפה לש ריבחתה .םיצבקה ינועיט ידי לע וניוצש םיצבקב םיוות תריפסו םיתב ,םילימ תריפס ,תושדח תורוש תריפס רפסמ רורבל תשמשמ סקוניל/סקינוי לש הלעפה תוכרעמב (םילימ תריפס) wc הדו

# wc [options] filenames

.הדוקפה ידי לע םיקפוסמה שומישהו תויורשפאה ןלהל

wc -l : Prints the number of lines in a file.
wc -w : prints the number of words in a file.
wc -c : Displays the count of bytes in a file.
wc -m : prints the count of characters from a file.
wc -L : prints only the length of the longest line in a file.

.ןלהל גצומכ cat תדוקפ תועצמאב ץבוקה טלפ תא הלגנ ואוב .תודוקפה תקידבל 'tecmint.txt' ץבוקב ונשמתשה .הז רמאמב םהלש םינימזה תואמגודהו םינועיטה המכ םע 'wc' הדוקפב שמתשהל לכונ ךיא הארנ ואוב זא

 cat tecmint.txt

Red Hat
CentOS
Fedora
Debian
Scientific Linux
OpenSuse
Ubuntu
Xubuntu
Linux Mint
Pearl Linux
Slackware
Mandriva

WC דוקיפל תיסיסב המגוד .1

.ץבוקה לש (םיתב רפסמ) 112 -ו (םילימ רפסמ) 16 ,(תורוש רפסמ) 12 םה ןלהל םיגצומה םירפסמה תשולש ."tecmint.txt" ץבוק לש תיסיסב האצות גיצת והשלכ רטמרפ ריבעהל ילבמ 'wc' הדוקפה

 wc tecmint.txt

12  16 112 tecmint.txt

תורושה רפסמ תריפס .2

.ץבוקה םש אוה ינשה הדשהו הריפסכ הצקוהש ןושארה קיתה טלפב .ץבוקב תושדחה תורושה תריפס תא גיצת האבה הדוקפה ,חיננ .ןותנ ץבוקמ תורושה רפסמ תא הסיפדמש ,'l-' תורשפאב שמתשה ץבוקב תושדחה תורושה רפסמ

 wc -l tecmint.txt

12 tecmint.txt

םילימה רפסמ תגצה .3

.ץבוקב םילימה תא רופסל ידכ האבה הדוקפה תא דלקה .ץבוקב םילימה רפסמ תא סיפדמ 'wc' הדוקפה םע 'w-' טנמוגראב שומיש

 wc -w tecmint.txt

16 tecmint.txt

םיוותהו םיתבה רפסמ תריפס .4

.ץבוקב המאתהב םיוותו םיתב לש ללוכה רפסמה תא וסיפדי 'wc' הדוקפה םע 'm-' -ו 'c-' תויורשפאב שומיש תעב

 wc -c tecmint.txt

112 tecmint.txt
 wc -m tecmint.txt

112 tecmint.txt

רתויב ךוראה וקה לש הגוצתה ךרוא .5

.ץבוקב ('סקוניל יעדמ') רתויב הכוראה םיוותה תרוש תא ונל שי ,ןכל .ץבוקב (םיוותה רפסמ) רתויב הכוראה הרושה ךרוא תא סיפדהל ןתינ התועצמאב ,'L-' ןועיט תרשפאמ 'wc' הדוקפה

 wc -L tecmint.txt

16 tecmint.txt

םיתורישב תופסונ תויורשפא קודב .6

.הדוקפה תרושמ 'man wc' וא 'wc –help' תא לעפה טושפ ,wc הדוקפב הרזעו ףסונ עדימ תלבקל

 wc --help

Usage: wc [OPTION]... [FILE]...
  or:  wc [OPTION]... --files0-from=F
Print newline, word, and byte counts for each FILE, and a total line if
more than one FILE is specified.  With no FILE, or when FILE is -,
read standard input.
  -c, --bytes            print the byte counts
  -m, --chars            print the character counts
  -l, --lines            print the newline counts
  -L, --max-line-length  print the length of the longest line
  -w, --words            print the word counts
      --help			display this help and exit
      --version			output version information and exit

Report wc bugs to [email 
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'wc invocation'