# Run command

**URL:** <https://discourse.julialang.org/t/run-command/28668>\
**Category:** General Usage\
**Created:** [September 11, 2019, 10:15pm UTC](https://discourse.julialang.org/t/run-command/28668 "2019-09-11T22:15:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luiz1](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Luiz1](https://discourse.julialang.org/u/Luiz1)\
**Post date:** [September 11, 2019, 10:15pm UTC](https://discourse.julialang.org/t/run-command/28668/1 "2019-09-11T22:15:56Z")

</div>

I need to run:

run(`zip code.zip "*.jl"`)

But \* does not work. Help please.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [September 11, 2019, 11:16pm UTC](https://discourse.julialang.org/t/run-command/28668/2 "2019-09-11T23:16:03Z")

</div>

Julia’s Cmd objects don’t spawn a shell, which is why that doesn’t work.

You can directly spawn a shell via something like `run(`bash -c ls *`)` if you want, but that depends on a particular shell being present on your system, and isn’t a good idea if you interpolate variables into the command since that could lead to injection attacks. But it can be convenient for quick REPL work.

For a more robust solution, see [https://github.com/vtjnash/Glob.jl](https://github.com/vtjnash/Glob.jl).

edit: or `readdir`, `walkdir`, and the other commands in the [Filesystem section of the docs](https://docs.julialang.org/en/v1/base/file/).

---

<div class="post-metadata">

**Author:** ![Luiz1](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@Luiz1](https://discourse.julialang.org/u/Luiz1)\
**Post date:** [September 12, 2019, 3:00pm UTC](https://discourse.julialang.org/t/run-command/28668/3 "2019-09-12T15:00:30Z")

</div>

I found another solution. Using “InfoZIP” package and filtering jl files using “filter” function.

But I wanted to understand why my code does not work. Thanks!!
