What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

Remove embedded fonts from a pdf.

Terminal - Remove embedded fonts from a pdf.
gs -sDEVICE=pswrite -sOutputFile=- -q -dNOPAUSE With-Fonts.pdf -c quit | ps2pdf - > No-Fonts.pdf
2009-03-25 03:46:00
User: qubyte
Functions: gs
Remove embedded fonts from a pdf.

It's sometimes useful to strip the embedded fonts from a pdf, for importing into something like Inkscape. Be warned, this will increase the size of a pdf substantially.

I tried this with only gs writing with -sDEVICE=pdfwrite but it doesn't seem to work, so I just pipe postscript output to ps2pdf for the same effect.


There are 6 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

On my ubuntu/debian system, there is a pdf2ps command (a script), which invokes gs in a similar manner. So you could possibly try this instead:

pdf2ps With-Fonts.pdf | ps2pdf - > No-Fonts.pdf

I'm somewhat of a novice at this stuff, but I think the "stripping" happens only because postscript *cannot* embed fonts. Usually I want to embed fonts for submission of papers in PDF.

Comment by bwoodacre 401 weeks and 5 days ago

I'm pretty sure postscript embeds fonts. If you look in a ps or eps file you can actually read bits, so like pdf the specification must include standard fonts.

I'm not entirely sure how mine works, although I do get the individual flags. I really just added the pipe. It's based on a one liner I saw a long time ago that spat out postscript from postscript.

Comment by qubyte 401 weeks and 5 days ago

I've looked through the manpage for gs 8.61 and can't see how the specified options are asking the postscript interpreter to discard font information. This just seems more like a side effect to me rather than deliberate program action.

Comment by bwoodacre 401 weeks and 5 days ago

Yup. That's pretty much the conclusion that I came to. It could be that you need to add a flag to preserve fonts and that's what's going on. Either way, it's worked for me for years and I've found it very useful.

I should note (and sorry this is confusing!) that when I say `remove embeded fonts' what I really mean is turn all the letters into normal vector graphics. This way the file is composed without any reference to text. The obvious side effects are that text in the pdf becomes unselectable and the file size goes up. I do this because Inkscape seems to fall over when it has to handle pdf fonts, and this fixes it.

Comment by qubyte 401 weeks and 5 days ago

I updated it to get rid of a couple of needless bits.

Comment by qubyte 401 weeks and 5 days ago

Your point of view

You must be signed in to comment.