Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I suppose there may be a one-line Linux command to check that.

share|improve this question
I'm curious why you'd want to check though – Thomas W. Jun 6 '12 at 14:02
up vote 4 down vote accepted

I don't know if you can specifically identify what you're looking for, and I'm not entirely sure what you mean since Google Apps is a suite of stuff. Sites are hosted by other products that form a part of Google Apps. I'm assuming that you mean to refer to Google Sites.

The function below actually looks for sites that contain GSE in their server name in the HTTP headers. Cursory tests indicate that this will identify Google Sites, but those tests are incomplete.

Define this function somewhere. You can type it directly into Bash, or put it into one of your shell startup files:

function hosted_by_google_sites {
  if [[ "$(curl --head --silent "$1" | egrep '^Server:')" =~ GSE ]]; then
    return 0
    return 1

You can use it like this:

if hosted_by_google_sites ""; then


hosted_by_google_sites "" && echo "Yes. Hosted by Google sites."

You said you wanted a one-liner. I'll leave that as an exercise for you, since representing this as a function is far superior, IMO. It could be done as a one-liner, but it'd be messy.

share|improve this answer
That's right, it was Google Sites. That's exactly it, no need for one-liner. Thank you. – Strapakowsky Jun 12 '12 at 3:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.