Count the Lines

Easy · Pipelines & Redirection · wc · Redirection

Problem

Print the number of lines in data.txt, and nothing else.

wc -l data.txt would print the filename too. Redirect the file into wc instead, so only the number appears.

Examples

Input: data.txt with 3 lines
Output: 3

Approaches

Related problems

Start free on Cariara · Coding problems · System design studio

Starting Python
No results yet.

          
↑↓ move ↵ open esc close

Labs

Loading labs…

Run with your own input

Starting Python

Loading Python…