# Get internal link for a file in Nextcloud from a local command line

**URL:** <https://help.nextcloud.com/t/get-internal-link-for-a-file-in-nextcloud-from-a-local-command-line/152774>\
**Category:** 📱 Desktop & mobile clients\
**Tags:** desktop-client, ubuntu, nc25, linux\
**Created:** [December 31, 2022, 5:28pm UTC](https://help.nextcloud.com/t/get-internal-link-for-a-file-in-nextcloud-from-a-local-command-line/152774 "2022-12-31T17:28:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![meonkeys](https://help.nextcloud.com/user_avatar/help.nextcloud.com/meonkeys/32/27937_2.png) [@meonkeys](https://help.nextcloud.com/u/meonkeys)\
**Post date:** [December 31, 2022, 5:28pm UTC](https://help.nextcloud.com/t/get-internal-link-for-a-file-in-nextcloud-from-a-local-command-line/152774/1 "2022-12-31T17:28:38Z")

</div>

Is there a way to get the internal link for a sync’d file from the command line? From a client, I mean, not using `occ` on the server.

Something like:

```nohighlight
$ ls ~/Nextcloud
foo.txt

$ nextcloud-cli internal-link ~/Nextcloud/foo.txt
https://nextcloud.example.com/f/1857192

```

I often want to refer to a sync’d file in Talk or an email. I don’t want to create new share links, I want to use the canonical/permalink for a file since the people I’m sharing with already have access.

I have the Nextcloud desktop app running, so I can get the internal link from the Files app (aka Nautilus). I can also get this internal link from the sharing sidebar in the web browser, I’m just looking for a way to avoid several mouse clicks/movements in either. (A Nextcloud cli client tool/method would be handy for other kinds of automation, too.)

Another related idea is that perhaps the URL displayed in the web browser address bar should actually be the internal link, since that’s the only portable / canonical / permalink to a file in Nextcloud, as far as I can tell.

---

<div class="post-metadata">

**Author:** ![meonkeys](https://help.nextcloud.com/user_avatar/help.nextcloud.com/meonkeys/32/27937_2.png) [@meonkeys](https://help.nextcloud.com/u/meonkeys)\
**Post date:** [January 7, 2023, 5:41am UTC](https://help.nextcloud.com/t/get-internal-link-for-a-file-in-nextcloud-from-a-local-command-line/152774/2 "2023-01-07T05:41:15Z")

</div>

I wrote this. Feedback welcome!

> **[GitHub - meonkeys/ow: Rudimentary Nextcloud command-line client](https://github.com/meonkeys/ow)**
>
> Rudimentary Nextcloud command-line client . Contribute to meonkeys/ow development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 8:39pm UTC](https://help.nextcloud.com/t/get-internal-link-for-a-file-in-nextcloud-from-a-local-command-line/152774/3 "2024-12-14T20:39:35Z")

</div>


