

{"id":110411,"date":"2022-09-14T09:00:48","date_gmt":"2022-09-14T03:30:48","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=110411"},"modified":"2022-09-14T09:39:02","modified_gmt":"2022-09-14T04:09:02","slug":"wc-command-in-linux","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/","title":{"rendered":"WC Command in Linux"},"content":{"rendered":"<p>In this article, we will be going through what wc is, a brief history, understanding its output, the syntax, and options of the wc command in linux. In the end, we will also be looking into some really cool examples of the wc command in action!<\/p>\n<h3>What is linux wc command?<\/h3>\n<p>Wc is an abbreviation for \u201cWord Count\u201d. It is a command-line-based utility in Linux-based operating systems that counts the number of characters, lines, and words in a file or data stream.<\/p>\n<p>We might come across numerous scenarios where we might need to see the number of words, characters, or lines are there in a file. One good example is writing an article in a \u201c.txt\u201d file, and need to see the word count to not exceed the word count.<\/p>\n<p>You can use the wc command with the options available to specify how it should function and format and print in the output. The wc command can accept zero or more input file names. If at all you don\u2019t specify a file name, or when the file is \u201c-\u201d, the wc command will read the standard input (stdin).<\/p>\n<p>If we simply run the wc command with no options, it will print the data in the following order: newline, word, character, byte, and maximum line length. We will look into the output of the wc command and understand it in the later sections.<\/p>\n<h3>History of linux wc command<\/h3>\n<p>The first appearance of the wc command was in the first version of UNIX. It was part of the X\/Open portability Guide since the second issue of 1987. The wc command was later inherited into the first version of POSIX and the Single Unix Specification.<\/p>\n<p>Wc command once use to be part of the GNU Textutils package, but now it is a part of the GNU Coreutils package. The wc command that comes in the GNU Coreutils pack was written, designed, and developed by Paul Rubin and David MacKenzie.<\/p>\n<p>The wc command is also available in other operating systems other than Linux. For example, it is available in Microsoft Windows as a part of the GNUWin32 project and UnxUtils collection of the native Win32 port, it is also available in MSX-DOS 2 ias part of ASCII\u2019s MSX-DOS 2 tools package.<\/p>\n<h3>Syntax of wc command in Linux<\/h3>\n<p>The syntax of the wc command is extremely simple:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wc &lt;options&gt; &lt;file&gt;<\/pre>\n<p>Let us take a closer look at the fields in the syntax of the wc command:<\/p>\n<h4>1. &lt;options&gt;<\/h4>\n<p>This field takes in a range of options that specify how the wc command should function and print the output.<\/p>\n<h4>2. &lt;files&gt;<\/h4>\n<p>This field takes in the name of the file you want to count the text. You can also specify the path of a specific directory or data stream in this field.<\/p>\n<h3>Options used with the wc command<\/h3>\n<p>The wc command, unlike most of the commands in Linux, has only a handful of options, to be more specific only 8 (out of which 2 are not considered as options). Let us take a look at them:<\/p>\n<h4>1. -c<\/h4>\n<p>This option prints the number of bytes. You can also write this option as \u201c&#8211;bytes\u201d.<\/p>\n<h4>2. -m<\/h4>\n<p>This option prints the number of characters. You can also write this option as \u201c&#8211;chars\u201d.<\/p>\n<h4>3. -l<\/h4>\n<p>This option prints the number of lines. You can also write this option as \u201c&#8211;bytes\u201d.<\/p>\n<h4>4. -w<\/h4>\n<p>This option prints the number of words. You can also write this option as \u201c&#8211;words\u201d.<\/p>\n<h4>5. -L<\/h4>\n<p>This line prints the length of the longest line. You can also write this option as \u201c&#8211;max-line-length\u201d.<\/p>\n<h4>6. &#8211;files0-from=&lt;filename&gt;<\/h4>\n<p>This option reads the input from the file specified by null-terminated names in the file specified by you.<\/p>\n<h4>7. &#8211;version<\/h4>\n<p>This option prints out the information about the wc command you are using in your system and then exits.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/version-of-the-wc-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110747\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/version-of-the-wc-command.webp\" alt=\"version of the wc command\" width=\"780\" height=\"179\" \/><\/a><\/p>\n<h4>8. &#8211;help<\/h4>\n<p>This option prints the help menu as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/help-menu-of-the-wc-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110749\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/help-menu-of-the-wc-command.webp\" alt=\"help menu of the wc command\" width=\"780\" height=\"530\" \/><\/a><\/p>\n<h3>Understanding output of Linux wc command<\/h3>\n<p>We can also run a wc command with no options at all, Here are a couple of examples (for both a file and a datastream):<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/understanding-the-output-of-the-wc-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110750\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/understanding-the-output-of-the-wc-command.webp\" alt=\"understanding the output of the wc command\" width=\"748\" height=\"125\" \/><\/a><\/p>\n<p>If you notice carefully, the wc command printed out 3 sets of numbers, let us look at what they represent.<\/p>\n<p>1. The first number represents the lines.<\/p>\n<p>2. The second number represents the number of words.<\/p>\n<p>3. The third number represents the number of characters.<\/p>\n<p>Therefore the data about the CPU information had 104 lines, 640 words, and 3696 characters, whereas the text file \u201ccars2.txt\u201d has 8 lines, 12 words, and 128 characters.<\/p>\n<p>Now that we have laid down the fundamentals let us explore the possibilities of the wc command in the terminal. Let us consider the text file shown below to use the wc command on:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/sample-text-file-to-test-the-wc-command-on.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110751\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/sample-text-file-to-test-the-wc-command-on.webp\" alt=\"sample text file to test the wc command on\" width=\"734\" height=\"241\" \/><\/a><\/p>\n<h3>Counting the number of words<\/h3>\n<p>To count the number of lines, pair the wc command with the option \u201c-w\u201d or \u201c&#8211;words\u201d as shown in the output below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wc -w &lt;file&gt;<\/pre>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-words.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110752\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-words.webp\" alt=\"counting the number of words\" width=\"780\" height=\"121\" \/><\/a><\/h3>\n<h3>Counting the number of lines<\/h3>\n<p>To count the number of words, pair the wc command with the option \u201c-l\u201d or \u201c&#8211;lines\u201d as shown in the output below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wc -l &lt;file&gt;<\/pre>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-lines.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110753\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-lines.webp\" alt=\"counting the number of lines\" width=\"780\" height=\"117\" \/><\/a><\/h3>\n<h3>Counting the number of characters<\/h3>\n<p>To count the number of characters or letters, pair the wc command with the option \u201c-c\u201d or \u201c&#8211;bytes\u201d as shown in the output below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wc -c &lt;file&gt;<\/pre>\n<h3><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-characters.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110754\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-characters.webp\" alt=\"counting the number of characters\" width=\"780\" height=\"117\" \/><\/a><\/h3>\n<h3>Finding the length of the longest line<\/h3>\n<p>To print the number of characters in the longest line, use the wc command with the option \u201c-L\u201d as shown in the output below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wc -L &lt;file&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/finding-the-length-of-the-longest-line.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110755\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/finding-the-length-of-the-longest-line.webp\" alt=\"finding the length of the longest line\" width=\"746\" height=\"277\" \/><\/a><\/p>\n<p>In the above output the line \u201cXUV 500-mahindra\u201d is the longest line which has 16 characters long.<\/p>\n<h3>Printing the number of lines and length of the longest line<\/h3>\n<p>You can also combine the options of the wc command, for example, If you want the wc command to display the total number of lines and the length of the longest line pair the options \u201cl\u201d and \u201cL\u201d as shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wc -lL &lt;file&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/printing-the-number-of-lines-and-length-of-the-longest-line.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110756\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/printing-the-number-of-lines-and-length-of-the-longest-line.webp\" alt=\"printing the number of lines and length of the longest line\" width=\"758\" height=\"121\" \/><\/a><\/p>\n<p>Note that in the above example the first number represents the total number of lines and the second number represents the number of characters in the longest line. It will not be printed in any other format, as the wc command follows the following order and no one can change it: newline, word, character, byte, and maximum line length.<\/p>\n<h3>Printing the total number of words and characters<\/h3>\n<p>To print the total number of words along with the number of characters, pair the options \u201cw\u201d and \u201cc\u201d with the wc command as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/printing-the-total-number-of-words-and-characters.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110757\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/printing-the-total-number-of-words-and-characters.webp\" alt=\"printing the total number of words and characters\" width=\"780\" height=\"105\" \/><\/a><\/p>\n<p>Again, if you notice, the number of words is printed first followed by the number of characters.<\/p>\n<h3>Displaying the count information of multiple files<\/h3>\n<p>You can count the number of lines, words, and characters of more than 1 file in just one wc command, to do so, simply write the filenames one after the other separated by a space as shown below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">wc &lt;file1&gt; &lt;file2&gt; &lt;file3&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/displaying-the-count-information-of-multiple-files.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110758\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/displaying-the-count-information-of-multiple-files.webp\" alt=\"displaying the count information of multiple files\" width=\"766\" height=\"144\" \/><\/a><\/p>\n<p>After printing the count information of all the files you specify, wc also prints the total at the end.<\/p>\n<h3>Displaying the count information of multiple data streams<\/h3>\n<p>To print the count information of multiple data streams, simply specify the path one after the other separated by a space as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/displaying-the-count-information-of-multiple-data-streams.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110759\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/displaying-the-count-information-of-multiple-data-streams.webp\" alt=\"displaying the count information of multiple data streams\" width=\"712\" height=\"125\" \/><\/a><\/p>\n<h3>Counting the number of files in a directory<\/h3>\n<p>Using the wc command we can also count the number of files in a directory. We simply pipe the ls command to the wc command and count the number of lines or words (words as names of files is only one word).<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-files-in-a-directory-using-the-wc-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110760\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-files-in-a-directory-using-the-wc-command.webp\" alt=\"counting the number of files in a directory using the wc command\" width=\"432\" height=\"132\" \/><\/a><\/p>\n<p>In the above output, the pipe symbol takes in the output of the ls command (which lists the contents of the directory) and passes it as the input of the wc command.<\/p>\n<p>We can pipe the wc command with hundreds of Linux commands to count the information of a specific quantity, let us look at a few examples:<\/p>\n<h3>Counting the number of users<\/h3>\n<p>To printout the number of user accounts, pipe the \u201cgetent passwd\u201d command with the wc command and count the number of lines as shown:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-users-using-the-wc-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110761\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/counting-the-number-of-users-using-the-wc-command.webp\" alt=\"counting the number of users using the wc command\" width=\"605\" height=\"88\" \/><\/a><\/p>\n<h3>Counting the \u201c&#8211;files0-from=&lt;f&gt;\u201d option<\/h3>\n<p>The option \u201c&#8211;files0-from=&lt;filename&gt;\u201d allows the wc command to read the input from the files specified by NUL-terminated names in the file you specified. If the file you specified is \u201c-\u201d (as shown in the output below), the wc command will read names from the standard input (STDIN).<\/p>\n<p>For example, you can search for files using the find command and provide those files to the wc command by piping them as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/read-the-input-from-the-files-specified-by-nul-terminated-names-in-the-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110762\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/read-the-input-from-the-files-specified-by-nul-terminated-names-in-the-file.webp\" alt=\"read the input from the files specified by nul terminated names in the file\" width=\"780\" height=\"190\" \/><\/a><\/p>\n<p>The command in the above screenshot printed all the names of the directories in the \u201c\/etc\u201d directory whose names start with \u201chost\u201d.<\/p>\n<h3>Using wc command without a file<\/h3>\n<p>Yup! We can also use the wc command without a file, we can simply echo a sentence and then pipes it with the wc command to get the count information, here is an example:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/using-wc-command-without-a-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110763\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/using-wc-command-without-a-file.webp\" alt=\"using wc command without a file\" width=\"644\" height=\"78\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>As you saw, even though the wc command is a really simple command, you can pipe it with different commands and produce desired results. You have now learned what wc is, a brief history of it, the syntax, and the options of the command. You have also learned the format and order of the output of the wc command including some beautiful examples of the wc command in action.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will be going through what wc is, a brief history, understanding its output, the syntax, and options of the wc command in linux. In the end, we will also be&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":110615,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[27082,27081],"class_list":["post-110411","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-syntax-of-linux-wc-command","tag-wc-command-in-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WC Command in Linux - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn what wc is, a brief history, understanding its output, the syntax, and options of the wc command in linux with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WC Command in Linux - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn what wc is, a brief history, understanding its output, the syntax, and options of the wc command in linux with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-14T03:30:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-14T04:09:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/wc-command-in-linux.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WC Command in Linux - DataFlair","description":"Learn what wc is, a brief history, understanding its output, the syntax, and options of the wc command in linux with examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"WC Command in Linux - DataFlair","og_description":"Learn what wc is, a brief history, understanding its output, the syntax, and options of the wc command in linux with examples.","og_url":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2022-09-14T03:30:48+00:00","article_modified_time":"2022-09-14T04:09:02+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/wc-command-in-linux.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"WC Command in Linux","datePublished":"2022-09-14T03:30:48+00:00","dateModified":"2022-09-14T04:09:02+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/"},"wordCount":1515,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/wc-command-in-linux.webp","keywords":["syntax of linux wc command","wc command in Linux"],"articleSection":["Linux Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/","url":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/","name":"WC Command in Linux - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/wc-command-in-linux.webp","datePublished":"2022-09-14T03:30:48+00:00","dateModified":"2022-09-14T04:09:02+00:00","description":"Learn what wc is, a brief history, understanding its output, the syntax, and options of the wc command in linux with examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/wc-command-in-linux.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/wc-command-in-linux.webp","width":1200,"height":628,"caption":"wc command in linux"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/wc-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Linux Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/linux\/"},{"@type":"ListItem","position":3,"name":"WC Command in Linux"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=110411"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110411\/revisions"}],"predecessor-version":[{"id":110764,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110411\/revisions\/110764"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/110615"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=110411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=110411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=110411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}