How to Set a New PATH in Bash, Ksh, and Zsh

How to Set a New PATH in Bash, Ksh, and Zsh

Written By
i
iDoLinux
May 16, 2025

The PATH is an essential environment variable in Linux and Unix-like systems. It defines the directories where the shell looks for executable files when you type commands (like ping, useradd, and others). Sometimes, you might need to modify the PATH to include custom directories or tools. The method to do this depends on the shell you’re using, whether it’s bash, zsh, or ksh. This article will guide you on how to set the PATH in each of these popular shells.

i

iDoLinux

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.