# Add DietPi commands to zsh

**URL:** https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266
**Category:** Troubleshooting
**Tags:** zsh, shell
**Created:** [1 May 2021 16:07 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266 "2021-05-01T16:07:45Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Mossy](https://dietpi.com/forum/user_avatar/dietpi.com/mossy/32/87_2.png) [@Mossy](https://dietpi.com/forum/u/Mossy)
#### Post date: [1 May 2021 16:07 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/1 "2021-05-01T16:07:45Z")

</div>

Hello,  
I have installed zsh on my installation of DietPi. However now I cannot figure out how to add the various DietPi commands to my zsh shell. The whereis command does not give me a path to add to my PATH.

Thank you for your time and help.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [1 May 2021 16:11 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/2 "2021-05-01T16:11:30Z")

</div>

DietPi scripts are located at

```nohighlight
/boot/dietpi

```

---

<div class="post-metadata">

### Author: ![Mossy](https://dietpi.com/forum/user_avatar/dietpi.com/mossy/32/87_2.png) [@Mossy](https://dietpi.com/forum/u/Mossy)
#### Post date: [1 May 2021 16:15 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/3 "2021-05-01T16:15:15Z")

</div>

> [@](#):
>
> DietPi scripts are located at
> 
> ```plaintext
> /boot/dietpi
> 
> ```

Thank you. That seems to work, but when I use sudo I get command not found.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [2 May 2021 12:08 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/4 "2021-05-02T12:08:26Z")

</div>

probably the path to be added to root user as well?

At least on bash DietPi is loading the alias from /etc/bashrc.d/dietpi.bash

---

<div class="post-metadata">

### Author: ![Mossy](https://dietpi.com/forum/user_avatar/dietpi.com/mossy/32/87_2.png) [@Mossy](https://dietpi.com/forum/u/Mossy)
#### Post date: [2 May 2021 13:55 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/5 "2021-05-02T13:55:56Z")

</div>

Okay. I got it. I had to modify the path in the /etc/sudoers file.

For anyone else needing this information, be sure to use sudo visudo /etc/sudoers to modify the file, you will find the default path right on the first screen.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [2 May 2021 14:08 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/6 "2021-05-02T14:08:28Z")

</div>

thx for sharing

---

<div class="post-metadata">

### Author: ![Mossy](https://dietpi.com/forum/user_avatar/dietpi.com/mossy/32/87_2.png) [@Mossy](https://dietpi.com/forum/u/Mossy)
#### Post date: [2 May 2021 14:09 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/7 "2021-05-02T14:09:14Z")

</div>

> [@](#):
>
> thx for sharing

No problem. Thanks for your assistance.

---

<div class="post-metadata">

### Author: ![dazeb](https://dietpi.com/forum/user_avatar/dietpi.com/dazeb/32/3366_2.png) [@dazeb](https://dietpi.com/forum/u/dazeb)
#### Post date: [14 February 2022 21:38 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/8 "2022-02-14T21:38:26Z")

</div>

I seem to have found myself a reasonable solution somewhere but cannot remember where i found it.

tested on 8.1

Place at the top of .zshrc

```nohighlight
export PATH=/usr/bin:/boot/dietpi:/bin:/usr/sbin:/sbin:$PATH

```

Place at the bottom of .zshrc

```nohighlight
/boot/dietpi/dietpi-login

```

Seems to have restored the majority of functionality for me, things like dietpi-launcher commands and the login motd.

---

<div class="post-metadata">

### Author: ![middlebaws](https://dietpi.com/forum/user_avatar/dietpi.com/middlebaws/32/3356_2.png) [@middlebaws](https://dietpi.com/forum/u/middlebaws)
#### Post date: [18 January 2023 18:59 UTC](https://dietpi.com/forum/t/add-dietpi-commands-to-zsh/5266/9 "2023-01-18T18:59:50Z")

</div>

This guide should be pinned in somewhere of documentation.

Great work dazeb!
