Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

In Org-mode I would like to insert the result of a Unix command in a field. For instance, consider I have the following table:

| /        |
| /bin     |
| /usr/bin |
| /lib     |
| /usr/lib |

I would like to insert a second column such as

$2 = <result of `du -sh $1` >

Is this possible?

share|improve this question
up vote 6 down vote accepted

This is an approximation to your problem:

#+TBLNAME: pepe
| /tmp      |
| /usr/info |

#+begin_src sh :var tt=pepe
du -sh $tt

| 4.0K | /tmp      |
| 532K | /usr/info |
share|improve this answer
I copy/pasted your table snippet and pressed C-c C-c, the table isn't updated and I only get the msg `Local setup has been refreshed'. How can I execute the formula? – rahmu Jun 26 '12 at 22:34
This is actual cut/paste from my test. C-c C-c should be done over the source block (not over the table). And you must have sh added to org-babel-load-languages setting. – Juancho Jun 26 '12 at 22:50
It worked with Org-mode version 7.8.11, but I cannot seem to add sh to org-babel-load-languages on Org-mode 6.33x version (old version I have at work). Any chance you know how to do this on older versions? – rahmu Jun 26 '12 at 23:07

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.