about-the-path

path vs PATH

https://github.com/asadprodhan/about-the-path

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.6%) to scientific vocabulary

Keywords

environment-variables path
Last synced: 6 months ago · JSON representation ·

Repository

path vs PATH

Basic Info
  • Host: GitHub
  • Owner: asadprodhan
  • License: gpl-3.0
  • Default Branch: main
  • Homepage:
  • Size: 71.3 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
environment-variables path
Created over 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Citation

README.md

About the PATH

AUTHOR: Dr Asad Prodhan https://asadprodhan.github.io/

DOI


PATH is a case-sensitive term in the Linux operating system. The lower case, path, is the location of a particular file or directory. The upper case, PATH, is called an environmental variable.

Now, what is an environmental variable?

To explain that, let me ask ‘why your Linux computer is displaying everything in English, not in another language?’. Well, this is because you set ‘LANGUAGE=enAU:en’ when you set up your computer. Likewise, ‘LCTIME="en_AU.UTF-8"’ will set the time in English. Run ‘locale’ command in your terminal and you will see something like below:



<img width="250" height="220" src="https://github.com/asadprodhan/About-the-PATH/blob/main/PATH_Variables.PNG"

Fig. Environmental variables

All these variables (the left-hand side phrases of the ‘=’ sign in the above figure) are basically setting up the environment how your Linux computer will display the output. As such, these variables are called ‘Environmental Variables’.

In accordance, there is an environmental variable called PATH. PATH contains the locations (paths) for various installed softwares or executables in your computer. So, when you write a command in your terminal and hit ‘Enter’, your Linux machine will look for its executable in the locations saved in the PATH variable.

If you run ‘echo $PATH’, you will see a collection of paths that are separated by a colon mark (:).

You can keep adding paths to the PATH variable as you install new softwares over times.

For example, you have installed ‘guppy’ basecalling software in your computer. And you want to run the 'guppy' command from any directory in your computer. To do so, you will need to add the path (location) of the 'guppy' software in your computer to the PATH variable.

How to add a path to the PATH variable?

  • ‘cd’ to the directory, which contains guppy

  • get the path of this directory by running PWD command, say the output is something like /home/user_name/Softwares/ont-guppy/bin

  • check your existing PATH variable:

echo $PATH

  • run

export PATH=$PATH:/home/user_name/Softwares/ont-guppy/bin

  • now check again: echo $PATH

The above ‘export’ command will add ‘/home/user_name/Softwares/ont-guppy/bin’ to the existing collections of paths in the PATH variable.

Now, when you exit your terminal, this newly added path will drop from the PATH variable automatically.

This means that you will need to repeat the above steps to execute ‘guppy’ from any directory in your computer.

To avoid it, you can add “export PATH=$PATH:/home/user_name/Softwares/ont-guppy/bin” to the bashrc profile in your Linux computer.

This will add the guppy path permanently to the PATH variable.

How to add a path to the PATH variable permanently?

  • ‘cd’ to your user home directory by running just ‘cd’. The output will be something like: /home/user_name

  • then, run nano .bashrc

  • add the following line to the .bashrc profile

export PATH=$PATH:/home/user_name/Softwares/ont-guppy/bin

  • save and close the .bashrc profile

Now, you can run ‘guppy’ from any directory in your computer, not just from the one where you downloaded and installed ‘guppy’.

That’s the power of the PATH environmental variable!! It is briefly called as 'PATH variable'.

Owner

  • Name: Asad Prodhan
  • Login: asadprodhan
  • Kind: user
  • Location: Perth, Australia
  • Company: Department of Primary Industries and Regional Development

Laboratory Scientist at DPIRD. My work involves Oxford Nanopore Sequencing and Bioinformatics for pest and pathogen diagnosis.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Prodhan"
  given-names: "M. Asaduzzaman"
  orcid: "https://orcid.org/0000-0002-1320-3486"
title: "About the PATH"
version: 1
doi: 10.5281/zenodo.11068991
date-released: '2024-04-25'
repository-code: "https://github.com/asadprodhan/About-the-PATH/tree/v1"
preferred-citation:
  type: article
  authors:
  - family-names: "Prodhan"
    given-names: "M. Asaduzzaman"
    orcid: "https://orcid.org/0000-0002-1320-3486"
  doi: "10.5281/zenodo.11068991"
  journal: "Zenodo"
  title: "About the PATH"
  year: 2024

GitHub Events

Total
Last Year