HackerRank - Head of a Text File #1

April - 25/2025

Problem:

In this challenge, we practice using the head command to display the first n lines of a text file. Display the first 20 lines of an input file.

# Input

# Output

# Solution

            
    head -n 20
    

# Solution_01

            
    while read line 
    do
        echo "$line";
    done | head -n 20
  

Post: