The head tag has no wiki summary.
1
vote
3answers
53 views
zcat | head : write error from large gz file
I was trying zcat to get only the first 1M lines of a compressed .gzip file into a new one.
However, I get the following error:
$ zcat path/to/R2.fq.gz | head -100 >R2.fqtest
head: write error: ...
3
votes
2answers
161 views
Opposite of tail: all lines except the last n lines
How can I discard the last n lines of a file with a unix command line filter?
That would be sort of the opposite of tail: tail discards the first n lines but pipes the rest through, but I want the ...
1
vote
1answer
38 views
What's the best way to view lines X through Y of a large file?
I have a very large text file and I want to view, say, lines 2000 through 2010 (with the line numbers included)
I know one sort of roundabout way of getting there:
sc -l [file]
cat -n [file] | tail ...
1
vote
1answer
237 views
Unix tool to output first n characters in an UTF-8 encoded file
I want to print the first 1000 characters in an UTF-8 encoded file. I know that the head tool can print the first n bytes of a file, but it may cut a character in the middle so that I get garbled ...
8
votes
2answers
872 views
Using 'head' or 'tail' on HUGE text file - 19 GB
I have a problem with viewing chunks of a very large text file. This file, approximately 19 GB, is obviously too big to view by any traditional means.
I have tried head 1 and tail 1 (head -n 1 ...
1
vote
1answer
289 views
How to solve “Broken Pipe” error when using awk with head
I'm getting broken pipe errors from a command that does something like:
ls -tr1 /a/path | awk -F '\n' -vpath=/prepend/path/ '{print path$1}' | head -n 50
Essentially I want to list (with absolute ...
2
votes
2answers
99 views
How to copy head of files to another folder, keeping tree structure?
I have a bunch of huge files (4GB+ each) with the same extension in a directory structure in a network drive, but am only interested in the first few bytes of each, so I'd like to copy them all to my ...
0
votes
2answers
610 views
Stopping after first line of output
I try to do the following in a Bash script: run a command (such as tail -f log_file), wait until a specific output arrives, then stop the command, and go on with the script.
I tried the following, ...
2
votes
3answers
279 views
How to grab a random section in the middle of a huge file?
I have a huge log file of around 3.5 GB and would like to sample random sections in the middle of say 10 MB for the purpose of debugging what my application is doing.
I could use head or tail ...
