Answers.Body: <p>In PHP it looks like this is what I need:</p>
  
  <pre><code>return (new CRM_Extension_System())-&gt;getDefaultContainer()-&gt;baseDir;
  </code></pre>
  
  <p>So in <code>bash</code> I can use <code>cv</code>:</p>
  
  <pre><code>cv ev 'return (new CRM_Extension_System())-&gt;getDefaultContainer()-&gt;baseDir'
  </code></pre>
  
  <p>or better still, as pointed out be Tim:</p>
  
  <pre><code>cv ev 'return CRM_Core_Config::singleton()-&gt;extensionsDir'
  </code></pre>
  
  <p>which means this one liner will take you to the directory:</p>
  
  <pre><code>cd `cv ev 'return CRM_Core_Config::singleton()-&gt;extensionsDir;' --out=pretty`
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-23T00:35:11.753Z
Answers.Text: I happened to find this way as the simplest but if there is a non-programtic way that would be awesome!
Answers.UserDisplayName: ErichBSchulz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-23T20:03:05.893Z
Answers.Text: (1) That's a clever way. FWIW, the traditional PHP snippet find the default container is `CRM_Core_Config::singleton()->extensionsDir;`. (2) Coincidentally, I've been mulling a form of this problem in https://github.com/civicrm/cv/pull/14
Answers.UserDisplayName: Tim Otten
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-22T12:33:23.360Z
Answers.LastActivityDate: 2017-02-20T06:18:57.667Z
Answers.LastEditDate: 2017-02-20T06:18:57.667Z
Answers.UserDisplayName: ErichBSchulz
Answers.Body: <p>You can find your extension directory by going to <strong>Administer menu » System Settings » Directories</strong> and checking the value for the "Extensions" directory.  If there's a token like [civicrm.root], you can determine its value <a href="https://civicrm.stackexchange.com/a/16611/12">with this technique</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-23T05:58:14.003Z
Answers.LastActivityDate: 2017-01-23T05:58:14.003Z
Answers.LastEditDate: 2017-04-13T12:53:13.167Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>This question surprised me a bit - but I have no clue about where to locate my extension directory!!</p>
  
  <p>Is there a simple way to reliably locate it (either programatically or via the UI)?</p>
  
Tags: <extension><civix>
Title: How can I locate my extension directory?
ThreadText: # How can I locate my extension directory?
  
  (Asked by: username_0 on 2017-01-22)
  
  This question surprised me a bit - but I have no clue about where to locate my extension directory!!
  
  Is there a simple way to reliably locate it (either programatically or via the UI)?
  
  **Tags:** extension, civix
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-01-23. Score: 4 | Accepted answer
  
  You can find your extension directory by going to **Administer menu » System Settings » Directories** and checking the value for the "Extensions" directory. If there's a token like [civicrm.root], you can determine its value [with this technique](https://civicrm.stackexchange.com/a/16611/12).
  
  
  ---
  
  ### Answer by username_0 on 2017-01-22. Score: 3
  
  In PHP it looks like this is what I need:
  
  ```
  return (new CRM_Extension_System())->getDefaultContainer()->baseDir;
  
  ```
  
  So in `bash` I can use `cv`:
  
  ```
  cv ev 'return (new CRM_Extension_System())->getDefaultContainer()->baseDir'
  
  ```
  
  or better still, as pointed out be Tim:
  
  ```
  cv ev 'return CRM_Core_Config::singleton()->extensionsDir'
  
  ```
  
  which means this one liner will take you to the directory:
  
  ```
  cd `cv ev 'return CRM_Core_Config::singleton()->extensionsDir;' --out=pretty`
  
  ```
  
  > **Comments:**
  > **username_0**: I happened to find this way as the simplest but if there is a non-programtic way that would be awesome!  
  > **username_1**: (1) That's a clever way. FWIW, the traditional PHP snippet find the default container is `CRM_Core_Config::singleton()->extensionsDir;`. (2) Coincidentally, I've been mulling a form of this problem in https://github.com/civicrm/cv/pull/14  
  
  ---
  
  