# How to run a file/script in the Linux terminal (Ubuntu) assigning multi-threading?

**URL:** <https://discourse.julialang.org/t/how-to-run-a-file-script-in-the-linux-terminal-ubuntu-assigning-multi-threading/67784>\
**Category:** Performance\
**Tags:** linux\
**Created:** [September 7, 2021, 1:34am UTC](https://discourse.julialang.org/t/how-to-run-a-file-script-in-the-linux-terminal-ubuntu-assigning-multi-threading/67784 "2021-09-07T01:34:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bojusemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bojusemo/32/26969_2.png) [@bojusemo](https://discourse.julialang.org/u/bojusemo)\
**Post date:** [September 7, 2021, 1:34am UTC](https://discourse.julialang.org/t/how-to-run-a-file-script-in-the-linux-terminal-ubuntu-assigning-multi-threading/67784/1 "2021-09-07T01:34:30Z")

</div>

Hi Folks,

Could anybody guide me, please?

How to run a file/script in the Linux terminal (Ubuntu) assigning multi-threading? If in the first line of the script I use `#!/path/of/bin/julia` it works without multi-threading. However, when I tried to use multi-threading by modifying that line as `#!/path/of/bin/julia --threads 4` it does not work.

Thank you so much in advance

Cheers

Boris

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [September 7, 2021, 4:56am UTC](https://discourse.julialang.org/t/how-to-run-a-file-script-in-the-linux-terminal-ubuntu-assigning-multi-threading/67784/2 "2021-09-07T04:56:31Z")

</div>

What do you mean by “it does not work”? What happens if you do this:

```julia
[nils@nils-folio1040g1 ~]$ julia --threads 4
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.6.1 (2021-04-23)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> Threads.nthreads()
4

```

---

<div class="post-metadata">

**Author:** ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Post date:** [September 7, 2021, 5:40am UTC](https://discourse.julialang.org/t/how-to-run-a-file-script-in-the-linux-terminal-ubuntu-assigning-multi-threading/67784/3 "2021-09-07T05:40:23Z")

</div>

I think the issue is with the shebang. Take a Look [here](https://docs.julialang.org/en/v1/manual/faq/#How-do-I-pass-options-to-julia-using-#!/usr/bin/env?)

---

<div class="post-metadata">

**Author:** ![bojusemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bojusemo/32/26969_2.png) [@bojusemo](https://discourse.julialang.org/u/bojusemo)\
**Post date:** [September 7, 2021, 6:05am UTC](https://discourse.julialang.org/t/how-to-run-a-file-script-in-the-linux-terminal-ubuntu-assigning-multi-threading/67784/4 "2021-09-07T06:05:11Z")

</div>

Thank you for your answer @nilshg
