Hide

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.
Hide

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:

Hide

News

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!
Hide

Top Tags

Hide

Functions

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

Google text-to-speech in mp3 format

Terminal - Google text-to-speech in mp3 format
wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world
2011-03-08 14:05:36
User: sairon
Functions: wget
36
Google text-to-speech in mp3 format

EDIT: command updated to support accented characters!

Works in any of 58 google supported languages (some sound like crap, english is the best IMO).

You get a mp3 file containing your query in spoken language. There is a limit of 100 characters for the "q" parameter, so be careful. The "tl" parameter contains target language.

Alternatives

There are 7 alternatives - vote for the best!

Terminal - Alternatives
say() { mplayer "http://translate.google.com/translate_tts?q=$1"; }
2011-09-08 03:34:24
User: daa
15

Usage examples:

say hello

say "hello world"

say hello+world

say(){ mplayer -user-agent Mozilla "http://translate.google.com/translate_tts?tl=en&q=$(echo $* | sed 's#\ #\+#g')" > /dev/null 2>&1 ; }
t2s() { wget -q -U Mozilla -O $(tr ' ' _ <<< "$1"| cut -b 1-15).mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=$(tr ' ' + <<< "$1")"; }
2013-10-16 23:29:59
User: snipertyler
Functions: cut tr wget
13

Usage: t2s 'How are you?'

Nice because it automatically names the mp3 file up to 15 characters

Modified (uses bash manip instead of tr)

t2s() { wget -q -U Mozilla -O $(cut -b 1-15

p=$(echo "hello world, how r u?"|sed 's/ /+/g');wget -U Mozilla -q -O - "$@" translate.google.com/translate_tts?tl=en\&q=$p|mpg123 -
2011-09-19 23:06:15
User: jhansen
Functions: echo mpg123 sed wget
4

same but redirecting to player and putting whaever text line.. works on my ubuntu machine ...

curl -A "Mozilla" "http://translate.google.com/translate_tts?tl=en&q=$(echo "$@" | sed 's/ /+/g')" | play -t mp3 -
2012-03-04 00:40:50
User: alphapapa
2

Whatever arguments you pass will be spoken out loud. (Put it in a script or shell function.)

Know a better way?

If you can do better, submit your command here.

What others think

Wow, I could spend all afternoon listening to my name in different European accents :-)

Comment by flatcap 305 weeks and 5 days ago

I tried this with Vietnamese, which I enter using unicode on a text editor and paste into the command line. However, I get nonsense back in the mp3 file. My command:

wget -q -U Mozilla -O output.mp3 "

It plays fine in the browser, which converts the URL:

http://translate.google.com/translate_tts?tl=vi&q=%C4%90o%C3%A0n

However, when I paste this url in the command line, I still get giberish:

wget -q -U Mozilla -O output.mp3 "

Any suggestions?

Comment by vinhdizzo 305 weeks and 5 days ago

I can't seem to get it to work, too. I guess it is an issue with wget? http://savannah.gnu.org/bugs/index.php?20863

Maybe curl will work?

Comment by sairon 305 weeks and 5 days ago

You could try piping the desired text into iconv to convert it to UTF-8 and only after that pipi the text into wget.

Comment by sairon 305 weeks and 5 days ago

I tried piping to iconv: no go.

curl also doesn't work.

Comment by vinhdizzo 305 weeks and 5 days ago

it works great, i change it to function

### usage: texttospeach en hello+world

texttospeach() {

wget -q -U Mozilla -O output.mp3 "

}

Comment by chmurli 305 weeks and 5 days ago

We now can play the sound live without the need to save the mp3 file before with a bash function ( a bash builtin replace all spaces by the + caracter ) :

say() { curl -s -A "Mozilla/5.0" "http://translate.google.com/translate_tts?tl=en&q=${@// /+}" | play -t mp3 -; } say "hello world"
Comment by sputnick 303 weeks and 5 days ago

Note on the previous command : requires sox

Comment by sputnick 303 weeks and 5 days ago

I've written a small ash shell script which can handle text flowing from a pipe and also gives you a warning when you exceed the 100-character limit. http://saironiq.blogspot.com/2011/03/google-text-to-speech-api.html

Comment by sairon 303 weeks and 5 days ago

I use wget with Google Translate to send sound to my Airport Express device: http://www.geekytidbits.com/2011/05/text-to-speech-through-airtunes/

Comment by bradyholt 292 weeks and 1 day ago

Are there alternative voices? Like male / female?

Comment by jesuisbenjamin 225 weeks ago

AFAIK there are no alternative voices

Comment by sairon 224 weeks and 6 days ago

Makers possess actually done a notable work by simply introducing gorgeous provider bags on the market. Before production these trendy bags, these people examine inside staff regarding the positives and negatives for these bags. And thus, they may be effective in generating dynamic ends up with terms of eco-friendly handbags. With this equivalent motive, they cook efficient by using materials to draw these types of bags within a much better method. Thus, you never face complications related to diminish tones by these kinds of vesicles.How about an thought to add elegance to be able to style by using modern leader bags? These kinds of bags have numerous pockets to help you simply maintain personalized factors within the place furnished by that. This can include lip stick, handkerchief, eye-writer, small note-book etcetera. Is certainly not a fascinating way for you to put together these matters inside handbag in the specific fashion, ofcourse certainly! Home handbags are probably the best selections of gals way too. You can easily lift belongings in these bags through place to yet another. Linked different types of videos to these bags are usually eye-catchy. This consists of bag wall mount clipa Chloe, bag being hungry clipa fushia, bag hanger clipa Brooke, bag wall mount clipa Kim and more. Are anyone aware of on-line gallerys positive aspects, most likely not! Employing this feature that is offered at web-portal, you may place an order of such exceptional solutions from your own home. Like this, you'll be able to conserve work-time regarding frantic http://www.hermesbeltsbirkinkellybag.co.uk/ timetable connected with business office rather than visiting for you to shopping mall for this function. Furthermore, you can certainly pick out sacs for good shades, measurements and also smoothness. Low-cost handbag barbs are also available of which straight match your funds. Therefore, it's not necassary to make just about any wait within getting in contact with for you to carrier's networks as soon as possible. In this manner, you'll be able to overcome problems related to confined stocks of those articles on retailers. Because of boost in need for this kind of remarkable duffels, they are sold and also brought in to a lot of parts of the globe.You are usually glad to understand that will problem linked to electrical wires of computer or even laptop which usually declines behind workplace is not hard to eliminate. Modern day accessories including cable-drop are great answer to setback apart this bigger picture. As a result, you ought to take a step ahead to use these kinds of trusted objects to make a difference inside offering security in order to cable-wires versus reductions as well as wastage. To create understanding of such improve gadget, you must reveal pictures of these goods about societal web sites. This includes face-book, facebook and many more. Keep in mind ones just one footstep with this direction can make successful modifications in this specific Modern. For first content material click this link: http://jennybrighton12.wp.com/2013/04/19/door-handbags-are-quite-sizzling/

Comment by stephanieg915 2 days ago

Tailored Record Bags- A Cost Effective Solution to Market Brand nameBeing an business owner, its substantial that you don't refuse an excellent possibility any kind of chance which will help market your marks in addition to businesses. You'll find such a large numbers of approaches to showcase your small business, still provided that you are looking for a straightforward along with informed technique, you may realize using custom looking bags using logo. The earnings utilizing these types of Eco-accommodating, eco friendly bags are usually significant teams. These are classy, modest and also buyer friendly. A single incredible method of advertise your level is usually to are charged custom made bags with brand in order to consumers and staff. This will aid consumers recollect the symbol identify along with logo design every time that they implement your current custom made bags we.e. through voyaging, purchasing etc. Not just by business breakthroughs, this purchasing bags along with emblem can also help saving nature's lawn. As we see more countries happen to be filing boycott around the utilization of plastic bags to defend character, making use of not for made bag bags (or even limited time bags as they are typically alluded to be able to because) will likely be a fantastic move to get ready the key reason why. The tote bags or drawstring back pack bags are found inside diverse sizes and shapes. These are developed away from textured polypropylene, therefore are generally in shape with regard to http://www.hermesbeltsbirkinkellybag.co.uk/ enduring outstanding weight load. If you need to communicate a bag involving modest fixed things or even a handful of muscle size issues from your current market, the actual customized bags having logo may be practical. The Drawstring backpack bags present you with this fresh focal point of inscribing the company in addition to level brand of the group with a big territory (as huge as the particular degree of the bag on its own). This may cause these individuals a terrific unit to assist advertise your company logo. Besides the company as well as indicate title, you are able to moreover indicate a good enrapturing meaning or maybe maneuvering to build your improvement significantly moreover getting. Simply make use of your current inventiveness as well as create your own personal unique what it really how you can actually enjoy the large drawstring rucksack bags. Which is not the item moms and dads. There are the ideal bargain more and more to the personalized purchasing bags. Though setting up your bags is but one section of the errand inside promoting your small business, the method that you are set to take it towards the gathering of men and women is often a distinct intense area of the job. A single remarkable route is to convey this bags because similar to consumers on the buy of items within your shop. The concept of definitely as take-always can easily genuinely encourage provide much more decidability in your brand name and level. As a businessman, the important that you simply get the best utilization of ones very limited time products to be able to showcase the markings. Most these days, when you weren't mindful of this customized purchasing bags this specific construct up probably have given you an agreeable being familiar with on a single. Believe in you make the most beneficial using the particular buying handbag bags.

Comment by stephanieg915 1 day ago

Your point of view

You must be signed in to comment.