Skip to main content

Questions tagged [wc]

`wc` utility counts newline, word, and byte for file(s) or standard input.

2 votes
1 answer
177 views

I expected these two commands to give the same count of how many lines in my file contain a letter: grep -c '[A-Z,a-z]' archive_for_TO.050225 11873 grep '[A-Z,a-z]' archive_for_TO.050225 | wc -l 11859 ...
Tim Osborn's user avatar
4 votes
1 answer
209 views

The distro is Ubuntu 22.04 and I'm running a newly-created ext4 filesystem that I have copied my setup to (using rsync on a different machine). I was running a manually written (python) filesystem ...
Elisa K. K.'s user avatar
0 votes
3 answers
155 views

I am trying to normalise a data file using the number of lines in a previous version of the data file. After reading these questions, I thought this could work: awk -v num=$(wc -l my_first_file.bed) '{...
Whitehot's user avatar
  • 245
0 votes
2 answers
81 views

I have some text files the looks something like this: Introduction and some meta data [00:00.000 --> 00:04.380] Lorem ipsum dolor sit amet, consectetur adipiscing elit. [00:04.980 --> 00:07.200]...
d-b's user avatar
  • 2,077
0 votes
0 answers
95 views

Running wc with multiple files is an order of magnitude faster than running it file by file. For example: > time git ls-files -z | xargs -0 wc -l > ../bach.x real 0m2.765s user 0m0.031s ...
tmaj's user avatar
  • 101
0 votes
0 answers
75 views

I want to count the number of file lines, so i use the command wc -l file. However, I notice that the result is incorrect which one less than the real number of lines. For example, the number of lines ...
Bioinfotec's user avatar
0 votes
2 answers
258 views

Getting Error with the below command to check on the Remote directory a specific type of files. The requirement is to get the count of the specific files. file_exists=$(sftp $FTP_UNAME@$FTP_HOST ls *$...
MALABIKA GARAI's user avatar
0 votes
0 answers
84 views

When running wc -l models.txt, we get the output which looks like 2113 models_work.txt. I wonder how to get the 2113 from that output using the cut command or something along those lines. It doesn't ...
Tung's user avatar
  • 171
0 votes
1 answer
75 views

find /volume1/file/* -type f \( -name "*DF*" -a -name "*LIVE*" \) -print0 | while IFS= read -d '' file do # extract the name of the directory to create dirName="${file%...
anisphia's user avatar
6 votes
2 answers
1k views

I am trying to understand why wc and stat report different things for /proc/[pid]/cmdline. wc says my shell's cmdline file is 6 bytes in size: $ wc --bytes /proc/$$/cmdline 6 /proc/10425/cmdline stat ...
Shane Bishop's user avatar
0 votes
2 answers
165 views

I want to know could I wc -l files are in subfolder.If only one file I can use code like below. find ./calss{1..20}/ -name 'C1.student' | xargs wc -l In fact, I have 20 folders , every folder contain ...
Roq's user avatar
  • 15
0 votes
1 answer
1k views

with command wc -l filename it is showing one row less when total number of rows inside file are 2 but it is showing 1 only. Please guide.
user555948's user avatar
5 votes
2 answers
2k views

I want to see how many lines exist in each file that has been found using the find command. I know I can use wc -l to find the lines number of a single file. But this does not work when piped from the ...
Saeed Neamati's user avatar
18 votes
3 answers
4k views

I have a command <streaming ls> | wc -l, it works fine, but the <streaming ls> takes a while, which means I don't get the final line count until a few minutes later. Is there a way to have ...
Foobar's user avatar
  • 273
1 vote
2 answers
1k views

I'm trying to create a summary of how many files in a directory have n number of lines in them. I'm using wc -l * | sort to print out the number of lines against the name of each file. What I'm trying ...
Doodling's user avatar

15 30 50 per page
1
2 3 4 5
14