Russ Allbery: More on displaying files with head
That was fun! Since my previous entry on using head to
display the contents of several files in a form that's easy to cut and
paste, multiple people have sent elaborations or related tricks. It
seemed like it would be a good idea to post a roundup, since I learned a
bunch.
Multiple people (I think Josh Triplett was the first) pointed out that one
can avoid having to pick a sufficiently large value of
-n by
instead using:
head -n -0 *.installWith GNU head at least, a negative number says to print out all lines of the file except that many at the end, so
-0 displays the whole
file, regardless of size. Unfortunately, while this works anywhere that I
am likely to run it, it's not specified by POSIX, while the original is.
Another variation, pointed out by Buck Huppmann, is:
tail -n +0 *.installThe
+0 syntax is required by POSIX, unlike the -0 syntax for
head... but unfortunately POSIX doesn't require that tail
supports multiple files and the headers, although it does for head.
Buck also pointed out that including the -v flag will always force
the header even if there's only one file, which is useful. (Although be
warned that -v isn't a POSIX-recognized flag.)
Markus Raab also pointed out the xsel utility, which I'd heard of
but hadn't ever used. If the goal is to cut and paste the output, using:
head -v -n -0 *.install xsel -iavoids the cut part by dumping the result directly into the X selection. Buck pointed out
xclip, which does the same thing. Both can be
used with the -o flag inside an editor to paste as well if you
don't want to reach for a mouse. In vi :r !xclip -o, and in Emacs,
C-u M-! xclip -o.
Finally, Guillem Jover metioned that:
grep . *.installdoes sort of the same thing with a different output format that may be more useful depending on what you're doing. (I find it less human-readable but more machine-parsable.)

I'm not a strong swimmer, and never have been. I was never confident in the
water as a child. In my teenage years, I had some skin issues that I was
very self-conscious about. Going to a boy's school where I was already
bullied, I didn't want to add material, so I avoided swimming. To this day, I
can barely swim 50 metres freestyle. To think I once had aspirations of getting
into the police, which required a
About half a decade ago, I created a gmail account (maybe
longer not so sure anymore). After testing it out for a while, I
decided that it wasn't for me; but as a gmail account comes with a
google account for free, I didn't throw it out.
As time went on, I added a few other things to that account. I
A new release of the
Implementing software to replace legacy systems is always a challenge, especially when you're dealing with a system with as much legacy as sendmail, which was first introduced as delivermail in 1979.
Pixmap ID Lifetimes under Present Redirection (Part Deux)
I
In order to get closer to my goal of reducing my dependence on centralized
services, I decided to setup my own XMPP / Jabber server on a