Questions tagged [head]

Use for questions on the head command which outputs the first x number of bytes or lines of a file

The head command outputs the first few bytes or lines from a file. If your question also deals combining this command with other text tools, also use the the tag.

125 questions
14
votes
1 answer

Alternative to 'head' that doesn't exit?

I need a utility that will print the first n lines, but then continue to run, sucking up the rest of the lines, but not printing them. I use it to not overwhelm the terminal with the output of a process that needs to continue to run (it writes…
IttayD
  • 381
3
votes
2 answers

why does it take so long to read the top few lines of my file?

I have a huge text file ~ 33Gb and due to its size, I wanted to just read the first few lines of the file to understand how the file is organized. I have tried head, but it took like forever to even finish the run. Is it because in UNIX, head needs…
B Chen
  • 133
0
votes
1 answer

Issues with head command

I am trying to get the top 20 lines of ldconfig -p and piping them to a .txt file. I am doing the below syntax: head -n 20 ldconfig -p > ex4-2-4a.txt I am getting an error for invalid option for the -p. I can run ldconfig -p > textfile.txt and get…
-1
votes
1 answer

"head -c " output displays before prompt

head -c 3 sample.txt The output will display before username in the prompt. Theuser@localhost:/home$ The is not being printed after $. Why is my terminal doing this?
Gee_k
  • 27