The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
22 views

Using head to see up to a character

I have some C source files and a lot of them have a single, 1-line comment at the top that offers a short description of what that program does (I haven't done anything complex enough to warrant a ...
0
votes
1answer
9 views

Extracting part of a large SQL dump

Is there a way to chain commands like grep and head together to extract a portion of a file? The problem is that somewhere in my .sql file I have an old data that I need to compare to new data and I ...
1
vote
1answer
79 views

head and cat don't recognize Microsoft Excel text files

I have a large .xls file with 53760 rows and 19 columns. I saved it as Tab Delimited Text in order to pre-process it through command line tools and load it into R later. However, when I run head ...
0
votes
1answer
88 views

How to resolve conflicts when two binaries have the same name

Running OS X (10.9), I have a program called 'HEAD' in /Applications/XAMPP/xamppfiles/bin/, which is related to libwww-perl. The OS also has an unrelated program called 'head' in /usr/bin/ Since the ...
0
votes
1answer
80 views

head hangs or doesn't terminate on Linux

I'm using, (uname -a says) Linux ip-x-x-x-x 2.6.21.7-2.fc8xen-ec2-v1.0 #1 SMP Tue Sep 1 10:25:30 EDT 2009 x86_64 GNU/Linux. I've got a script, foo.sh with 100 lines of code and when I run head ...
4
votes
1answer
976 views

How to easily break up a text file into pieces smaller than a threshold?

I have some text files that are 100 to 300 MB in length that I want to view in Emacs, but my Emacs gets into some performance issues opening and traversing such large files. Therefore, I'm looking ...
1
vote
3answers
500 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: ...
5
votes
2answers
3k 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
47 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
520 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
2k 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
518 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
151 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
1k 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
472 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 ...