We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Linux Shell
  3. Text Processing
  4. Head of a Text File #2

Head of a Text File #2

Problem
Submissions
Leaderboard
Discussions
Tutorial

In this challenge, we practice using the head command to display the first characters of a text file.

Display the first characters of an input file.

Input Format

A text file.

Output Format

Output the first characters of the text file.

Sample Input

 New York is a state in the Northeastern and Mid-Atlantic regions of the United States. 
New York is the 27th-most extensive, the third-most populous populated of the 50 United States. 
New York is bordered by New Jersey and Pennsylvania to the south.
About one third of all the battles of the Revolutionary War took place in New York.
Henry Hudson's 1609 voyage marked the beginning of European involvement with the area.

Sample Output

New York is a state 

Author

PRASHANTB1984

Difficulty

Easy

Max Score

2

Submitted By

31733

Need Help?


View tutorial
View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy