Use of wc and file commands
wc : This command is used to count total number of words,characters and lines in a given file.
Syntax:$wc <filename>
Ex:
$wc f1
Here wc counts total number of lines 3,number of words 6,number of character 28 and filename f1.
We can also use wc commands like
a)$wc -l f1 :To count number of lines in a file
b)$wc -w f1 :To count number of words in a file.
c)$wc -c f1 :To count number of characters in a file.
d)$wc -lw f1 :To count number of lines and words in a file.
e)$wc -wc f1 :To count number of words and characters in a file.
f)$w -lc f1 :To count number of lines and characters in a file.
file : This command is used to given file type.
Syntax:$file <filename>
Ex:
$file capitals
capitals is a ascii text file.
Ex:
$file ABC
ABC is a directory.
wc : This command is used to count total number of words,characters and lines in a given file.
Syntax:$wc <filename>
Ex:
$wc f1
Here wc counts total number of lines 3,number of words 6,number of character 28 and filename f1.
We can also use wc commands like
a)$wc -l f1 :To count number of lines in a file
b)$wc -w f1 :To count number of words in a file.
c)$wc -c f1 :To count number of characters in a file.
d)$wc -lw f1 :To count number of lines and words in a file.
e)$wc -wc f1 :To count number of words and characters in a file.
f)$w -lc f1 :To count number of lines and characters in a file.
file : This command is used to given file type.
Syntax:$file <filename>
Ex:
$file capitals
capitals is a ascii text file.
Ex:
$file ABC
ABC is a directory.
No comments:
Post a Comment