# How to start Julia REPL with a command?

**URL:** https://discourse.julialang.org/t/how-to-start-julia-repl-with-a-command/4892
**Category:** General Usage
**Tags:** question
**Created:** [July 17, 2017, 4:35am UTC](https://discourse.julialang.org/t/how-to-start-julia-repl-with-a-command/4892 "2017-07-17T04:35:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [July 17, 2017, 4:35am UTC](https://discourse.julialang.org/t/how-to-start-julia-repl-with-a-command/4892/1 "2017-07-17T04:35:30Z")

</div>

How do you start the Julia REPL with a command?

This would be equivalent to how adding code to `.juliarc.jl` works (but without having any permenance to it)

One way I thought of doing was to:

- make a scratch file and
- then load it using `julia ~/.../scratch.jl`

This just seems kind of hacky, though.

* * *

Use case:

I want to be able to do:

```julia
> julia | "using DataStructures"

```

// but the DataStructures is just an example and it changes frequently

(also, that’s just pseudo-code)

---

<div class="post-metadata">

### Author: ![Evey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evey/32/214967_2.png) [@Evey](https://discourse.julialang.org/u/Evey)
#### Post date: [July 17, 2017, 5:39am UTC](https://discourse.julialang.org/t/how-to-start-julia-repl-with-a-command/4892/2 "2017-07-17T05:39:53Z")

</div>

I think `$ julia -ie "using DataStructures"` does what you want? `-i` starts the REPL interactively and `-e` evaluates the code. 🙂

---

<div class="post-metadata">

### Author: ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)
#### Post date: [July 17, 2017, 5:49am UTC](https://discourse.julialang.org/t/how-to-start-julia-repl-with-a-command/4892/3 "2017-07-17T05:49:16Z")

</div>

Thanks!

// for the curious, this got used in a new [Julz command](https://github.com/djsegal/Julz.jl/commit/d44ab16a5e862df2291ab98ea44878c353c67040)
