Thamizhiniyan C S
HomeWriteupsResourcesCheatsheets
HackerRank
HackerRank
  • HackerRank
  • Linux Shell
    • Bash
    • Text Processing
      • Cut
      • Head
      • Middle
      • Tail
      • Tr
      • Sort
      • Uniq
      • Paste
    • Arrays In Bash
    • Grep Sed Awk
      • Grep
      • Sed
      • Awk
  • Regex
    • Introduction
    • Character Class
    • Repetitions
    • Grouping and Capturing
    • Backreferences
    • Assertions
    • Applications
  • Python
    • Introduction
    • Basic Data Types
    • Strings
    • Sets
    • Math
    • Itertools
    • Collections
    • Date and Time
    • Errors and Exceptions
    • Classes
    • Built-Ins
    • Python Functionals
    • Regex and Parsing
    • XML
    • Closures and Decorators
    • Numpy
    • Debugging
  • C
    • Introduction
    • Conditionals and Loops
    • Arrays and Strings
Powered by GitBook
On this page
  • Head of a Text File #1
  • Head of a Text File #2

Was this helpful?

  1. Linux Shell
  2. Text Processing

Head

Head of a Text File #1

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

Display the first 20 lines of an input file.

head -n 20

Head of a Text File #2

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

Display the first 20 characters of an input file.

head -c 20
PreviousCutNextMiddle

Last updated 1 year ago

Was this helpful?