Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to linux's command to see how many lines there are in a file

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Today, the editor to share with you is the linux to view the file how many lines of command introduction, many people do not understand, today, in order to let you know more about the linux to view the file how many lines of method, so to sum up the following content, let's look down. I'm sure you'll get something.

Use the wc command to view it specifically through wc-- help.

Such as:

Wc-l filename

Is to see how many lines there are in the file.

Wc-w filename

See how many word there are in the file.

Wc-L filename

How many words is the longest line in the file?

Wc command

The function of the wc command is to count the number of bytes, words and lines in the specified file, and to display the statistical results.

Syntax: wc [options] file...

Description: this command counts the number of bytes, words and lines in a given file. If no file name is given, it is read from standard input. Wc also gives presidential counts for all specified files. A word is the largest string distinguished by a space character.

The options for this command mean the following:

C counts the number of bytes.

-l count the number of rows.

-w count the word count.

These options can be combined.

The order and number of output columns are not affected by the order and number of options.

Always appear in the following order and each item has at most one column.

Number of lines, words, bytes, file name

If there is no file name on the command line, the file name does not appear in the output.

For example:

$wc-lcw file1 file24 33 file17 52 file21 11 85 total

Omit any option-the lcw,wc command executes as above.

This is the end of the command introduction on how many lines of the linux view file, of course, not only the above and everyone's analysis methods, but the editor can ensure its accuracy is absolutely no problem. I hope that the above content can have a certain reference value for everyone, and can be put into practice. If you like this article, you might as well share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report