Casie Bao


All the lights we cannot see


Bash

PATH

What is PATH

When you wish to install programs into other locations on your host, but be able to execute them easily without specifying their exact location. This can be easily done by adding a directory to your $PATH.

View PATH

echo $PATH

Install packages and add to path

  1. temporarily set path export PATH=<your-dir>:$PATH
  2. permenantly set path: add export PATH=<your-dir>:$PATH in .bashrc. Then restart the terminal.

which vs whereis

which: returns the pathnames of the file which would be executed in the current enviroment

whereis: searches for binary/source and manual page files.

For example,

whereis php => php: /usr/bin/php /usr/share/php /usr/share/man/man1/php.1.gz

# the php is executable, and some other stuff (e.g., man pages)

which php => /usr/bin/php
# returns only the php executable. 
Latest Articles

Python Modules

What is a Python egg?A Python egg is a structure embodying the release of a specific version of a Python module, comprising its code, resources and metadata. It needs to be importable and discovera...…

Read More
Eariler Articles

HTTP

IntroductionHTTP is a TCP/IP based communication protocol, used to deliver data, such as HTML files, images, query results etc., on the World Wide Web. HTTP specification specifies how client’s req...…

Read More