@kenanhancer/

BashCountWords

bash

No description

fork
loading
Files
  • main.sh
  • countryList.txt
  • sampleFile.txt
main.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#first column: total number of lines in the file
#second column: total number of words in the file
#third column:  total number of bytes in the file
#fourth column: file name

wc sampleFile.txt

wc countryList.txt

#multiple files
wc sampleFile.txt countryList.txt

#print only total number of lines
wc -l countryList.txt

#print only total number of words
wc -w countryList.txt

#print only total number of bytes
wc -c countryList.txt

#usage of multiple options
wc -lw countryList.txt

#usage of multiple options with multiple files
wc -lw sampleFile.txt countryList.txt