How can I execute system specific commands and get their response in Clojure? For example, let\'s assume we\'re on a Linux machine, how can I call top or free
top
free
You should be able to use the Java Runtime.exec method as follows:
(import 'java.lang.Runtime) (. (Runtime/getRuntime) exec "your-command-line-here")
The Runtime.exec method returns a Process object that you can query to get the standard output etc. as needed.