I'm trying to tangle my Emacs configuration file from shell.

I asked a question and was told to use org-tangle, but where is that?

I also tried ntangle, but that failed silently.

Also, I tried this command, but where does it output to?;)

emacs --batch --eval "(require 'org)" --eval '(org-babel-tangle-file "emacsen.org")'

2 Answers 2


ok, my org file was a symlink, so the output was in the directory it was pointing at;)

I never found org-tangle, but I guess I don't need it now;)

Also, I've filed a bug on ntangle, so I'll follow that over there.



You can find where a function is defined via C-h f followed by the function name (or via M-x find-function if the function has already been loaded).

org-babel-tangle-file is in ob-tangle.el however, ob-tangle also gets loaded when loading org, so that your current command should work fine.

If you do C-h f org-babel-tangle-file then you will find that it also takes an optional TARGET-FILE argument.

If you do not provide a target-file argument, then the output file will have the same name as the original, but ending in .el instead of .org, and it will be located in the same directory as your original file.

  • No, I meant org-tangle, which is a shell command. In some other thread here, they say that this command is included with Doom Emacs;) Commented Feb 14, 2023 at 15:34
  • Ah okay. It would be handy to mention that in your question, and also include a link to that thread. Commented Feb 14, 2023 at 16:11
  • Actually, I did mention it, saying "from shell";). Also, here's the other thread: emacs.stackexchange.com/questions/74280/… Commented Feb 15, 2023 at 17:58
  • "(If you are using doom emacs, org-tangle is provided in .emacs.d/bin/org-tangle.)"
    – Tyler
    Commented Jul 14, 2023 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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