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

The usage of the Linux basic command wc

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "the usage of the Linux basic command wc". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the usage of the basic Linux command wc.

Wc

Count the number of bytes, words and lines of the file.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Wc [options] file

2. List of options

Option

Description

-- version

Display command version information

-- help

Show help documentation

-c |-- bytes

Show only the number of bytes

-m |-- chars

Show only the number of characters

-l |-- lines

Show only the number of rows

-L |-- max-line-length

Displays the number of characters on the longest line in the file

-w | words

Show the number of words

3. Examples

1) display the number of bytes

[root@192 weijie] # cat 1.c

Hello world

I am david

Love linux

This code

Nihao ed

[root@192 weijie] # wc-c 1.c

53 1.c

2) display the number of rows

[root@192 weijie] # wc-l 1.c

5 1.c

3) display the number of words

[root@192 weijie] # wc-w 1.c

11 1.c

At this point, I believe you have a deeper understanding of "the use of the Linux basic command wc". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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