# How to use ~ in a Cmd

**URL:** <https://discourse.julialang.org/t/how-to-use-in-a-cmd/22844>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 6, 2019, 6:23pm UTC](https://discourse.julialang.org/t/how-to-use-in-a-cmd/22844 "2019-04-06T18:23:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [April 6, 2019, 6:23pm UTC](https://discourse.julialang.org/t/how-to-use-in-a-cmd/22844/1 "2019-04-06T18:23:17Z")

</div>

my goal is to run a command like

```julia
ranger ~/.julia/ --choosefile=$(joinpath(homedir(),".julia"))

```

however, i get this error when I try to use `~` in the path names

```nohighlight
julia> run(`ranger $("~/.julia/")`)
Inaccessible paths: ['~/.julia/']
ERROR: failed process: Process(`ranger '~/.julia/'`, ProcessExited(1)) [1]
Stacktrace:
 [1] run(::Cmd) at ./process.jl:724
 [2] top-level scope at none:0

```

how can I correctly get julia to build this `Cmd` and execute it?

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [April 6, 2019, 6:25pm UTC](https://discourse.julialang.org/t/how-to-use-in-a-cmd/22844/2 "2019-04-06T18:25:32Z")

</div>

Call `expanduser` on the path first.
