Skip to content

discuss-tech.com

Learning Everyday

  • Home
  • Contact
  • About
  • Toggle search form

PATH variable in linux

Posted on February 13, 2024February 13, 2024 By Ankit Joshi No Comments on PATH variable in linux

The PATH variable is an environment variable in Linux that holds a list of directories where the system searches for files. When a command is entered in the terminal, the system scans these directories in the order they are listed, attempting to locate the corresponding file.

To view your current PATH configuration, simply open a terminal and type:

echo $PATH

This command will display a colon-separated list of directories.

Modifying the PATH Variable:

1. Temporary Modification:

  • You can temporarily modify the PATH variable for your current session using the export command. For example:bashCopy codeexport PATH=$PATH:/path/to/your/directory This appends the specified directory to the existing PATH.

2. Permanent Modification:

  • For a permanent change, you can add the export statement to your shell configuration file (e.g., .bashrc for Bash)
  • echo 'export PATH=$PATH:/path/to/your/directory' >> ~/.bashrc
  • Remember to restart your terminal or use the source command to apply the changes.
Uncategorized

Post navigation

Previous Post: All about Environment Variables in Linux
Next Post: Cloning an Azure virtual machine to another region in another subscription

Related Posts

All about Environment Variables in Linux Uncategorized
A uew user’s guide to getting help with Linux commands Uncategorized

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2025 discuss-tech.com.

Powered by PressBook Masonry Dark