| Home | About Us | Sybase Training | Synergy | Consulting | Job Openings | Tech Videos | Rules and Disclaimer | Search |
![]() |
| Home | About Us | Sybase Training | Synergy | Consulting | Job Openings | Tech Videos | Rules and Disclaimer | Search |
|
'wc' command
|
|
06-17-2010, 03:06 AM
Post: #1
|
|||
|
|||
|
'wc' command
'wc' command is used to count the lines, words and characters in an inputfile. Syntax: wc [-lwcm] input_file Options: The following options can be given. -c count bytes -w count words -l count no. of lines -m count characters -C same as option 'm' By default wc will display the no.of lines, words and characters in a given input file. If multiple files are specified then wc will count the no.of lines, words and characters in each file. It will also dispaly the total no.of lines, words and characters from both files. Ex: consider the sample.txt file with the below contents hello this is an example good morning welcome to the world of unix !! The wc command when used on sample.txt will output the following. $wc sample.txt 3 14 70 sample.txt Ex: consider another file sample.txt with the following contents welcome to the world of korn shell programming unix commands are very powerful unix shell scripts are equivalent to dos batch files The wc command when used on sample1.txt will output the following. $wc sample1.txt 3 22 131 sample1.txt When both sample.txt and sample1.txt are given as input the following is output. $wc sample.txt sample1.txt 3 14 70 sample.txt 3 22 131 sample1.txt 6 36 201 total Think Deeply. Code Well. Saritha R Hyderabad. TechSupport-SeniorMember Synergy Project (SybaseTeam.Com) |
|||
|
« Next Oldest · Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| 'which' command | srama2 | 0 | 1,015 |
05-27-2010 08:32 AM Last Post: srama2 |
|
| scp command to transfer files | srama2 | 0 | 2,101 |
05-17-2010 08:00 AM Last Post: srama2 |
|
| last command | srama2 | 0 | 1,304 |
05-07-2010 06:24 AM Last Post: srama2 |
|
| Powerful usage of sort command in Unix - column wise sorting | pavan526 | 0 | 8,167 |
04-24-2010 01:08 PM Last Post: pavan526 |
|
| listing files using 'ls' command | srama2 | 0 | 1,829 |
04-23-2010 03:13 AM Last Post: srama2 |
|
| 'rmdir' command | srama2 | 0 | 1,224 |
04-20-2010 03:18 AM Last Post: srama2 |
|
| Processing Shell Script Options Using getopts Command | srama2 | 0 | 2,002 |
04-19-2010 03:41 AM Last Post: srama2 |
|
| cal command | srama2 | 0 | 1,303 |
04-14-2010 03:34 AM Last Post: srama2 |
|
| 'iostat' command | srama2 | 0 | 2,640 |
04-12-2010 06:23 AM Last Post: srama2 |
|
| tee command | srama2 | 0 | 1,556 |
04-09-2010 02:44 AM Last Post: srama2 |
|