# Problem running shell commands in Pluto

**URL:** <https://discourse.julialang.org/t/problem-running-shell-commands-in-pluto/66043>\
**Category:** Tooling\
**Tags:** pluto\
**Created:** [August 8, 2021, 9:03pm UTC](https://discourse.julialang.org/t/problem-running-shell-commands-in-pluto/66043 "2021-08-08T21:03:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin.squire](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevin.squire/32/62_2.png) [@kevin.squire](https://discourse.julialang.org/u/kevin.squire)\
**Post date:** [August 8, 2021, 9:03pm UTC](https://discourse.julialang.org/t/problem-running-shell-commands-in-pluto/66043/1 "2021-08-08T21:03:20Z")

</div>

I’m attempting to capture the output of a shell command in Pluto. In the REPL, the following works:

```plaintext
julia> oc = OutputCollector(`ls -al`)
OutputCollector(`ls -al`, Process(`ls -al`, ProcessRunning), OutputCollectors.LineStream(Pipe(RawFD(4294967295) closed => RawFD(23) active, 0 bytes waiting), Tuple{Float64, String}[], Task (runnable) @0x000000016c00c230), OutputCollectors.LineStream(Pipe(RawFD(4294967295) closed => RawFD(21) active, 0 bytes waiting), Tuple{Float64, String}[], Task (runnable) @0x000000016c00c450), Condition(Base.InvasiveLinkedList{Task}(nothing, nothing), Base.AlwaysLockedST(1)), Base.TTY(RawFD(14) open, 0 bytes waiting), false, true, false, Task[])

julia> stdout = collect_stdout(oc)
"total 254312<... output deleted ...>"

```

However, when I run the same thing in a Pluto notebook, I get no output from the command.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/1/d102d1d5190e1e74b31d7df277e5e793429193c7.png)

Is this a bug or expected behavior (i.e., because the notebook is sandboxed)? If the notebook is sandboxed by default, is there a way to enable shell commands?

Thanks,  
Kevin

---

<div class="post-metadata">

**Author:** ![Pascal\_Buhler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pascal_buhler/32/45582_2.png) [@Pascal\_Buhler](https://discourse.julialang.org/u/Pascal_Buhler)\
**Post date:** [January 4, 2023, 10:51am UTC](https://discourse.julialang.org/t/problem-running-shell-commands-in-pluto/66043/2 "2023-01-04T10:51:27Z")

</div>

Same Problem

 ![2023-01-04 11_49_Pluto](https://global.discourse-cdn.com/julialang/original/3X/6/0/60bbe6dff1d74aeeb200d5eba96dffe426b81deb.png)

---

<div class="post-metadata">

**Author:** ![orlando\_mendez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/orlando_mendez/32/211282_2.png) [@orlando\_mendez](https://discourse.julialang.org/u/orlando_mendez)\
**Post date:** [August 12, 2024, 6:05pm UTC](https://discourse.julialang.org/t/problem-running-shell-commands-in-pluto/66043/3 "2024-08-12T18:05:46Z")

</div>

same problem over here as well, and I’m using `Pluto v0.19.45 `.  
So this problem is not solved yet?

---

<div class="post-metadata">

**Author:** ![danielwe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielwe/32/35657_2.png) [@danielwe](https://discourse.julialang.org/u/danielwe)\
**Post date:** [August 12, 2024, 10:15pm UTC](https://discourse.julialang.org/t/problem-running-shell-commands-in-pluto/66043/4 "2024-08-12T22:15:46Z")

</div>

Which approach are you trying? `read(run(cmd))` is incorrect, you probably want `read(cmd, String)`:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/b/bb62413c1d0787cdb85019f4d7697b9db6fd5b9e.png)

---

<div class="post-metadata">

**Author:** ![orlando\_mendez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/orlando_mendez/32/211282_2.png) [@orlando\_mendez](https://discourse.julialang.org/u/orlando_mendez)\
**Post date:** [August 21, 2024, 7:05pm UTC](https://discourse.julialang.org/t/problem-running-shell-commands-in-pluto/66043/5 "2024-08-21T19:05:39Z")

</div>

HI @danielwe ,sorry for my late reaction, I was able to run the command as indicated. Thanks!
