ondir command not found

In this troubleshooting guide we learn how to fix ondir command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

ondir: command not found

or when using sudo you get the following error message

sudo: ondir: command not found

Solutions to ondir: command not found

How To Fix ondir: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu ondir is provided by ondir package.

ondir is:

ondir is a small program to automate tasks specific to certain directories. It works by executing scripts in directories when you enter and leave them. It may be used to set environment variables or change the umask depending on the current working directory.

This program is similar to the direnv package. In contrast to direnv, which expects the per-directory settings to be stored in the directory itself, ondir uses a central configuration file in the user’s home directory, and can match directories based on patterns.

ondir supports bash, zsh and fish out of the box.

To fix this problem, we can install more using the command below.

sudo apt-get -y install ondir

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install ondir.

sudo apt -y install ondir

Or if you have aptitude installed you can use the following command.

sudo aptitude install ondir

Summary

In this tutorial we learn how to fix ondir command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.