×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Google Introduces Command-Line Tool For Linux

timothy posted more than 2 years ago | from the google-reaches-the-beginning dept.

Google 210

Lomegor writes "'Ever wanted to upload a folder full of photos to Picasa from a command prompt?' Google introduced today a new project, Google CL, that lets you do that and much more. It's a new command line tool for Linux that acts as an interface with Google services; you can upload videos to YouTube or maybe post a new blog post in Blogger in just one line."

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

210 comments

sudo (5, Funny)

TheKidWho (705796) | more than 2 years ago | (#32620410)

sudo google Skylab -activate -w -terminate "Humans"

Re:sudo (5, Funny)

Quarters (18322) | more than 2 years ago | (#32620520)

I'm unclear as to how a defunct and destroyed cut-rate '70's era NASA space station that was built out of Atlas rocket parts would have either a web server or the ability to annihilate humanity.

Re:sudo REWIND (2, Informative)

interval1066 (668936) | more than 2 years ago | (#32620576)

sudo google SkyNet -activate -w -terminate -prejudice:extreme "Humans" && sudo google -reboot | grep "reality"

Re:sudo REWIND (3, Funny)

Josh04 (1596071) | more than 3 years ago | (#32621244)

I'm unclear as to how a defunct and destroyed cut-rate '70's era British Armed Forces Comms satellite that never made it out of geostationary orbit would have either a web server or the ability to annihilate humanity.

Re:sudo (1)

AnonymousClown (1788472) | more than 2 years ago | (#32620678)

Atlas? I thought they used a Saturn V that was supposed to be for another Moon mission for it - which made much easier to put it on the Saturn V that put into orbit.

Re:sudo (4, Informative)

ClickOnThis (137803) | more than 3 years ago | (#32621056)

Atlas? I thought they used a Saturn V that was supposed to be for another Moon mission for it - which made much easier to put it on the Saturn V that put into orbit.

Actually it was a modified S-IVB stage [wikipedia.org] -- the third stage used in the launches of the Apollo moon missions. On Apollo, the S-IVB was used for the insertion of the command and lunar modules into earth orbit, and for their trans-lunar injection.

Re:sudo (2, Interesting)

Anonymous Psychopath (18031) | more than 2 years ago | (#32620812)

I'm unclear as to how a defunct and destroyed cut-rate '70's era NASA space station that was built out of Atlas rocket parts would have either a web server or the ability to annihilate humanity.

Well, it did rain debris all over Australia. So it's really just a question of accuracy.

Re:sudo (0, Interesting)

Anonymous Coward | more than 2 years ago | (#32620884)

And that's why we need a GUI for these things!

Re:sudo (0)

Anonymous Coward | more than 3 years ago | (#32621132)

Is this a WHOOSH! moment, or are we just making the humor extra dry?

Re:sudo (0)

Anonymous Coward | more than 3 years ago | (#32621142)

wow... I bet your a blast at parties.

Re:sudo (2, Insightful)

catmistake (814204) | more than 3 years ago | (#32621454)

cut-rate '70's era NASA space station

Make a joke, fine, make a point, even better, but you should be old enough to remember SkyLab kicked ass, you insensitive clod!

Re:sudo (0)

Anonymous Coward | more than 2 years ago | (#32620560)

I believe you mean SkyNet.

Skylab was the U.S. space station launched in 1973 and destroyed on re-entry in 1979.

google roullette is now complete (4, Interesting)

Anonymous Coward | more than 2 years ago | (#32620618)

sudo $(googlecl imfeelinglucky malicious commands)

The Lesser Controlled (3, Interesting)

Rotworm (649729) | more than 2 years ago | (#32620422)

I think this is an interesting juxtaposition. I lessly the fonder of Google services because too often it seems things are centralised with the various Google Services. What I liked about Linux was it's decentralisation, that control was distributed to whomever had the capacity and the will to partake.

I don't suggest it's worthless that I can give content to Google from the command line, but that it seems to ideologically oppose one of the strengths of Linux. And artistic content is one area that is suffering from centralisation. Artistic content builds upon what came before it (I mention that because we're not all Lessig-educated), and copyright is increasingly centralising content to a small number of firms. Giving your content to Google isn't like giving your content to Disney, but it's submitting it to the control of a lessly interested party.

Re:The Lesser Controlled (3, Informative)

amRadioHed (463061) | more than 3 years ago | (#32621020)

What loss of control with Google services? If you want to store your stuff somewhere else it's usually fairly easy to do [dataliberation.org].

yes, but... (2, Insightful)

gandhi_2 (1108023) | more than 2 years ago | (#32620432)

...does it run anything besides linux?

a tool like this would rule for any platform.

i guess you could just roll your own python script or something.

Re:yes, but... (2, Insightful)

WrongSizeGlass (838941) | more than 2 years ago | (#32620454)

...does it run anything besides linux?

Is there something people want to run besides Linux?

Re:yes, but... (0, Offtopic)

blai (1380673) | more than 2 years ago | (#32620514)

yeah, Windows.

I like Linux, but I'm sure there are places where Windows handles things better than a a good kernel relying on a huge collection of patches and hacks.

Re:yes, but... (0, Insightful)

Anonymous Coward | more than 2 years ago | (#32620562)

but what is this "Windows" you keep referring to ?

Re:yes, but... (0, Flamebait)

clang_jangle (975789) | more than 2 years ago | (#32620710)

It's an obscure, very rickety OS built on top of DOS by a cheeky little company called "microsoft". Obviously they stole the name from the xwindows system, no doubt desperately hoping to cash in on the resulting confusion.

Re:yes, but... (-1, Redundant)

nxtw (866177) | more than 3 years ago | (#32621184)

cheeky little company called "microsoft"

A very large company, actually.

no doubt desperately hoping to cash in on the resulting confusion.

And quite successfully cashing in, too.

Re:yes, but... (0)

Anonymous Coward | more than 3 years ago | (#32621278)

Please mod parent commander obvious.

Re:yes, but... (4, Insightful)

SwedishPenguin (1035756) | more than 2 years ago | (#32620624)

Well apparently it's just a python script, so it is available for Windows. Though the last time I tried to use python from the CLI (what little there is) in Windows was a really big hassle, and I ended up just going for an unofficial prepackaged installer for that particular application which bundled Cygwin.

Re:yes, but... (0)

Anonymous Coward | more than 2 years ago | (#32620848)

The python CLI on linux is the same as on Windows... (well you lack middle mouse pasting which sucks but that's basically it). Also if you use the raw cli you are asking for pain anyway. Install ipython and working with the interactive prompt is a breeze.

Re:yes, but... (5, Insightful)

obarthelemy (160321) | more than 2 years ago | (#32620938)

there's a good CLI for Windows: http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx [microsoft.com]

Re:yes, but... (0)

Anonymous Coward | more than 3 years ago | (#32621590)

powershell blows goats. try doing something simple such as using the copy-item cmdlet. it's ridiculously slow due to a bad design. now try issuing it against a remote share. you can literally go travel paris, check out the sites and get back for the ending of the copy.

not to mention the ridiculously *horrible* and *cumbersome* way they implemented the entire shell. how many times must i type the damn '-' character in a freakin command.

it's also plagued with many bugs, granted it's new, it still sucks.

keep to python, perl or bash.

Re:yes, but... (2, Informative)

drinkypoo (153816) | more than 3 years ago | (#32621332)

install python from http://www.activestate.com/activepython/downloads [activestate.com]
download gdata from http://code.google.com/p/gdata-python-client/downloads/detail?name=gdata-2.0.10.zip&can=2&q= [google.com]
download googlecl from http://code.google.com/p/googlecl/downloads/detail?name=googlecl-0.9.5.tar.gz&can=2&q= [google.com]
unpack gdata and googlecl into their own dirs (I used 7zip)
in gdata and then googlecl dirs run python setup.py install
googlecl will be in c:\python26\scripts
the rest is left as an exercise to the reader but wrapping it in a cmd script is trivial

Re:yes, but... (1)

camperdave (969942) | more than 2 years ago | (#32620594)

I sometimes wish I still had my Atari 600XL. I could use a good game of Star Raiders to unwind once in a while.

Re:yes, but... (0, Redundant)

EvanED (569694) | more than 2 years ago | (#32620802)

Count me in with the Windows crew.

Actually I guess it would be more precise to say that I really don't want to run Windows, but it tends to piss me off a little less than Linux, BSD, etc. I actually hate both. (I can't speak to OS X; I haven't used it enough. Of course, Apple also refuses to either sell me a copy of OS X I can use on a non-Apple computer* or offer a mid-range, non-all-in-one desktop, so that's not going to change soon either.)

* Sure, I could set up a hackintosh. But I figure that if a company doesn't want me to give them money, I won't.

Re:yes, but... (0)

Anonymous Coward | more than 2 years ago | (#32620850)

there are other unixes out there besides linux...

Re:yes, but... (1)

gig (78408) | more than 3 years ago | (#32621050)

> Is there something people want to run besides Linux?

Yeah, Macs. All Mac applications can run shell scripts, and Python is included with every Mac, so a Photoshop-to-Picassa workflow would be very easy to create using Google CL. Or BBEdit-to-Blogger.

Re:yes, but... (2, Insightful)

LambdaWolf (1561517) | more than 3 years ago | (#32621130)

...does it run anything besides linux?

Is there something people want to run besides Linux?

And is anyone unable to run Linux?

No, seriously. Install VirtualBox [virtualbox.org] on your Windows system or whatever, throw Xubuntu [xubuntu.org] on a virtual machine, do whatever you want. The software doesn't cost a dime, you can do it with the hardware you have, and it's not even that difficult for a person of moderate geekiness. Okay, so it takes a lot of hard drive space, but gone are the days when you need to go drop a few hundred dollars on another computer or futz around with dual-booting and accidentally trash your MBR if you want a Linux system in addition to your current setup.

Re:yes, but... (0)

Anonymous Coward | more than 3 years ago | (#32621494)

yeah, BSD

Linux is ok, but I prefer BSD, any flavor. I'm not going to list the reasons why I prefer it to Linux, but I will tell you how Linux is like Apple.

Everything that Linux does was done by BSD and Windows first. Every time Linux comes out with a new technology, it's usually an answer to or free duplication of some new thing that Microsoft did to fuck you, or some really great utility that was first developed for BSD. Hooray and kudos for Linux in both regards. The way Linux (I guess I should specify not Linux, but penguinistas) is like Apple is in acting like they invented it... like Apple did with package management (AppStore)...

ok, lame rant over... just upset today that every KVM Is Linux based... why no BSD KVMs?

Cool, but... (2, Funny)

Anonymous Coward | more than 2 years ago | (#32620434)

....someone ought to write a GUI front end for it.

Re:Cool, but... (5, Funny)

wiredlogic (135348) | more than 2 years ago | (#32620484)

....someone ought to write a GUI front end for it.

Make it web based at that.

Re:Cool, but... (0)

Anonymous Coward | more than 3 years ago | (#32621100)

Of course make it web-based, so I can access it from Lynx.

Nerd RAGE! (3, Funny)

grasshoppa (657393) | more than 2 years ago | (#32620440)

A single tool to do EVERYTHING?

It's like they don't even USE linux.

Re:namespacing (5, Insightful)

Lord Bitman (95493) | more than 2 years ago | (#32620574)

organized into separate modules, but called as "google subcommand" so that you can still have a command called "picassa" and "blogger" and "search"... sounds good to me.

"do one thing, do it well" doesn't mean "make a thousand poorly-named tools and clutter /usr/bin"

"google foo" does one thing, does it well.
"google bar" does one thing, does it well.
"google" does one thing, does it well (passes commands to a dispatcher)

you're basically complaining about seeing a space where you pointlessly want a hyphen.

Re:namespacing (0)

Anonymous Coward | more than 2 years ago | (#32620696)

Dear Lord Biteme,
I believe grasshoppa is the teacher this evening. The lesson? A brand new word: whoosh !!


Best Wishes, Your Pal,
Capt. Obvious

Re:namespacing (2, Informative)

Hurricane78 (562437) | more than 2 years ago | (#32620740)

Protip:
for C in $GOOGLE_COMMANDS; do echo "google $C $*" > "/usr/local/bin/google-$C"; chmod +x "/usr/local/bin/google-$C" done
It’s not an appliance UI, but a real OS. Meant to help you automate things and fit like a glove. Use it!

Re:namespacing (1)

whoever57 (658626) | more than 3 years ago | (#32621260)

Protip:
for C in $GOOGLE_COMMANDS; do echo "google $C $*" > "/usr/local/bin/google-$C"; chmod +x "/usr/local/bin/google-$C" done

How about:
for C in $GOOGLE_COMMANDS; do alias $C="google $C" ; done
Put in a script that is executed by all users.

Re:Nerd RAGE! (1)

dotgain (630123) | more than 2 years ago | (#32620754)

It's like they don't even USE linux.

An example of a relatively recent, and linux-specific command, is 'mdadm'. (for managing Linux Software RAID in case you weren't aware). All of its submodes are selected as the first argument. This is an example of a utility that was undoubtedly created by core Linux Developers, and would seem contradictory to your ideal.

Re:Nerd RAGE! (0)

Anonymous Coward | more than 3 years ago | (#32621114)

It's like they don't even USE linux.

An example of a relatively recent, and linux-specific command, is 'mdadm'. (for managing Linux Software RAID in case you weren't aware). All of its submodes are selected as the first argument. This is an example of a utility that was undoubtedly created by core Linux Developers, and would seem contradictory to your ideal.

I'd blame you for not using your sarcasm detector, but they got marked insightful!

Re:Nerd RAGE! (0)

Anonymous Coward | more than 3 years ago | (#32621628)

This all reminds me of the windows NET commands when you are 4 options deep and still need to look up help to select one more it's just a little bit OTT

Search (2, Interesting)

MrEricSir (398214) | more than 2 years ago | (#32620446)

Too bad it doesn't support Google Search.

Re:Search (1)

Dragonslicer (991472) | more than 3 years ago | (#32620960)

Too bad it doesn't support Google Search.

While a Google-produced tool might do something nice as far as the format of the data, there's already a command line program for Google search called wget.

goosh (0)

Anonymous Coward | more than 2 years ago | (#32620474)

www.goosh.org

Not just for Linux (2, Informative)

sockonafish (228678) | more than 2 years ago | (#32620512)

It's written in Python and will run on any platform that Python will run on. That's pretty much every platform.

Re:Not just for Linux (5, Funny)

Bottles (1672000) | more than 2 years ago | (#32620582)

Except for actual, living pythons. To be fair, though, they are less a platform and more a series of tubes.

Re:Not just for Linux (0)

Anonymous Coward | more than 3 years ago | (#32621486)

Like the internet. ;-)

Re:Not just for Linux (2)

MrHanky (141717) | more than 2 years ago | (#32620642)

Every platform except the closed ones that don't allow you to run an interpreter, of course.

Re:Not just for Linux (1)

Shados (741919) | more than 2 years ago | (#32620684)

Its rare that someone will say something that makes Windows fall in the "open" category.

Re:Not just for Linux (2, Insightful)

dotgain (630123) | more than 2 years ago | (#32620916)

Every platform except the closed ones that don't allow you to run an interpreter, of course.

So, basically it runs on everything except the ZX81 [wikipedia.org] and the iPhone

Re:Not just for Linux (1)

gig (78408) | more than 2 years ago | (#32620918)

He meant "every [PC] platform", obviously. No, you can't run this on a game console or an iPod or a GPS.

Re:Not just for Linux (0)

Anonymous Coward | more than 2 years ago | (#32620896)

Correction: Python will not run on ANY platform. By definition, it'll crawl and slither. You want it to run? Python doesn't have a leg to stand on! Also if you want to truly understand python, you'll need a lisp interpreter.

Re:Not just for Linux (2, Insightful)

defaria (741527) | more than 3 years ago | (#32621060)

Just not so. You can write unportable python just as you can with any language. Step one, code in an assumption that is only present on the current platform, e.g. make a call to execute a command such as, say, diff(1) which exists on Linux but not on Windows. Or use a Windows only style pathname (e.g. C:\Windows\Temp) or even rely on functionality that one very similar architecture has but the other doesn't (e.g. execute an ll command, which only works on HP-UX, or a ps command which has different options on different OSes or say an ls --auto=color on Solaris). Just because the language exists on an architecture does not mean that you cannot foolishly doing something in that language that is architecturally dependent on a specific architecture, thus rending your script non-portable and non-operational on other architectures.

lINUX uSERS sO sTUPID cANT uSE gui !! (-1, Troll)

Anonymous Coward | more than 2 years ago | (#32620534)

lINUX USERS CANT USE A GUI? sTUPID !!

You are not logged in. You can log in now using the convenient form below, or Create an Account, or post as God Almighty Hisself !!

Re:lINUX uSERS sO sTUPID cANT uSE gui !! (1)

jedidiah (1196) | more than 3 years ago | (#32621246)

It's not that we can't. We would rather just not be bothered.

GUIs for all of their niceties tend to take a O(c) problem and turn them into a O(n) problem.

If I wanted to spend all day pushing pretty buttons, I would have acquired an OS with them.

Works really well (2, Funny)

itamblyn (867415) | more than 2 years ago | (#32620590)

For anyone that spends a lot of time on the command line, this is pretty huge.

Re:Works really well (0)

Anonymous Coward | more than 2 years ago | (#32620694)

Except the majority of people, who don't use google's services, besides search and browsing youtube, which were not included...

Re:Works really well (0)

Anonymous Coward | more than 2 years ago | (#32620808)

Yeah, wake me up when they port it C. Not like anybody using the command line already has a bunch of shell scripts that pass the appropriate options and arguments to wget/curl.

Zzzzzzzz!

Name clash! (2, Interesting)

martin-boundary (547041) | more than 2 years ago | (#32620654)

There's already a "google" command line command bundled with surfraw [debian.org]. You can type google searchstring and it will launch a browser with the results. I use w3m as the browser, which makes it easy to pipe the results into a script if I need to.

Re:Name clash! (1)

Aladrin (926209) | more than 3 years ago | (#32621094)

So some random person made a command with the name of an extremely famous company and you think it's the company's fault for picking that name for the command?

Re:Name clash! (1)

martin-boundary (547041) | more than 3 years ago | (#32621174)

Surfraw has been around for ages, and this isn't a new type of naming problem. When Google chose Chromium for its open source browser, there already existed an open source project called Chromium [reptilelabour.com].

Forgive me if I expect Google's engineers to do a quick google search before picking a name that's already been taken for a few years.

Re:Name clash! (1)

retchdog (1319261) | more than 3 years ago | (#32621580)

I'd frankly rather that Google® crush the waste of disk space and net traffic that comprise that crappy cutrate shmup.

okay (1)

nimbius (983462) | more than 2 years ago | (#32620662)

so i didnt RTFA but i cant help wondering if this headline is just better written as "google writes linux script!"

generally you see people working in a command line, because they have some insight or minimal inclination to program things
of this nature. one has to wonder what google has achieved here if the majority of command line users in a few hours or days
could just as easily have crafted the same thing.

Re:okay (1)

badboy_tw2002 (524611) | more than 2 years ago | (#32620776)

Um, they saved a majority of command line users a few days or hours, and the minority that couldn't do this themselves now can. Anything else you're wondering about?

Re:okay (4, Interesting)

Joe Tie. (567096) | more than 3 years ago | (#32621064)

If you're not familiar with google's api it's a pretty large time investment. Partially because of the size, but also because they're often not the most up to date. A lot of the doc api for example doesn't work with docs created under the system that's been up for a few months now. But that fact isn't listed anywhere in their documentation, or even very easy to find by searching because the error message is so generic and uninformative.

Re:okay (1)

nxtw (866177) | more than 3 years ago | (#32621228)

I've found documentation coming out of Google to be somewhat weak. The docs for GWT, for example, are lacking in some areas - they don't even have complete Javadoc coverage AFAIK.

And using Google to look for GWT information isn't always useful, as it returns a lot of pages that no longer apply to the latest version of GWT. I also get lots of results for old Java documentation - look up anything in the Java libraries, and the results from Sun will probably be for Java 1.5 or 1.4.2 or even earlier, not Java 1.6.

Thank you! (4, Informative)

garcia (6573) | more than 2 years ago | (#32620714)

Google updated Google Docs recently and I found that the new version didn't support some of the Gadgets that the old version did. I became quite concerned that the old and hackalicious python scripts I was using to upload CSV files that power my website's crime dashboards [lazylightning.org]--something which would suck to have to recode.

I'm going to have to check this out and see if it works much in the same way like allowing me to just replace a Google Docs spreadsheet that already exists something which I require to keep my old code working.

Nice to see that they are continuing to make their commandline tools easier to use as I have to admit I was having some problems getting the ones I currently use to work but now that they are I certainly don't want to loose that functionality (I am good at using those scripts, just not coding new ones so any of the troll comments which say I should do it myself are not necessary, thanks :))

Re:Thank you! (2, Insightful)

garcia (6573) | more than 2 years ago | (#32620742)

Err I was concerned they wouldn't work when Google switched to the full on new version. I need a beer.

I wrote a google CLI tool once (0, Redundant)

sootman (158191) | more than 2 years ago | (#32620858)

Some guy used to always post the worst questions to a list I was on. Like, the kind of stuff where you could google the subject line of his email and get the answer. So I wrote...#!/bin/sh
lynx -dump google.com/search?q=$1+$2+$3+$4+$5 | mail -s "Automated response" list@example.com
What I really wanted was for the list admin to put a filter on the server that would automatically take his messages and do that.

Re:I wrote a google CLI tool once (0, Offtopic)

icebraining (1313345) | more than 3 years ago | (#32621264)

Sending HTML to a mailing list? For shame...

Re:I wrote a google CLI tool once (1)

sootman (158191) | more than 3 years ago | (#32621532)

lynx -dump parses the HTML. It would be like going to a web page with a browser and then select all, copy, paste. curl will give you HTML source.

linux (1)

helix2301 (1105613) | more than 2 years ago | (#32620926)

I must saying being a big linux user this is a really cool tool. I like the way it kind of gives me that putty ssh feeling. lol :)

I wrote a Google CLI tool once (4, Funny)

sootman (158191) | more than 2 years ago | (#32620936)

(Crap, hit 'submit' instead of 'preview')
I used to be on a list and this one guy would always post the worst questions--the kind of stuff where you could google the subject line of his email and get the answer. So I wrote...
#!/bin/bash
lynx -dump google.com/search?q=$1+$2+$3+$4+$5 | mail -s "Automated response" list@example.com

What I really wanted was for the list admin to put a filter on the server that would automatically take his messages and do that to them. Of course I never actually used it. :-) I eventually just filtered him.

Mac OSX works great too (0)

Anonymous Coward | more than 3 years ago | (#32621086)

Although I wish "google calendar list" returned dates and times instead of just titles and urls.

Command to load pictures to Picasaweb (1, Interesting)

Anonymous Coward | more than 3 years ago | (#32621552)

It wants me to log in. It tells me

    The site anonymous is requesting access to your Google Account for the product(s) listed below.

What is the security implication to granting access to "site anonymous?"

Somehow it seems right to post this as AC. ;)

Nifty, but... (4, Interesting)

sootman (158191) | more than 3 years ago | (#32621576)

... it'd be equally cool if they had a really open API and you could just use a script with curl to upload.

Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...