Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In unix/linux systems, you have a user id ('john') and a home directory ('/home/john'). The home directory has an abbreviation, the tilde: ~ (at the start of a directory path) means the same as your home directory ("/home/john").</p> <p>In the home directory are several files that begin with a period (aka dot files because they start with a dot, i.e., a period). When you log in, the shell (i.e., the program that processes the command line when you type commands) that is started to supply you a command line looks for these files and reads them, using their content to initialize your shell environment. You can see these files (if they exist) by entering these commands at the command line:</p> <pre><code>cd ls -a </code></pre> <p>The <code>cd</code> with no args means 'change the current directory to be my HOME directory. The <code>ls</code> command lists files in a directory (among other things); the <code>-a</code> option says 'show hidden files'. Hidden files are those that start with a period - this is the convention used in unix/linux to 'hide' files.</p> <p>The .profile (said out loud it's often pronounced 'dot profile') file is one such dot file used for initializing your environment. </p> <p>The PATH environment variable is used by the shell to search for executable files (programs).</p> <p>You can google for 'how to update PATH in profile' and similar to learn more about the topic.</p> <p>Here is a typical snippet found in a .profile file; its purpose is to allow you to run programs that are stored in the directory /usr/mypackage/bin. </p> <pre><code>PATH="/usr/mypackage/bin:$PATH" export PATH </code></pre> <p>Putting a directory on the PATH allows you to type just a program name ('myprogram') in place of the longer form ('/usr/mypackage/bin/myprogram').</p> <p>You can see the effect of this snippet using <code>echo $PATH</code>; it will show the entire value of the PATH variable. The value should be a list of paths (directories) separated by colon. A simple example:</p> <pre><code>echo $PATH /usr/mypackage/bin:/usr/bin:/bin </code></pre> <p>That should give you a foothold to begin investigating the details. Trying searching for topics like 'how do I set up my linux/unix login', 'what is .profile file', etc., to learn more.</p> <p>It's advisable to use double-quotes when setting the value of PATH to encapsulate any 'usual' characters that may be in the names of the items in the path. Single quotes are not suitable for this as they will prevent the evaluation of $PATH (which is what supplies your existing path when defining your new path value). For more on quotes, <a href="https://stackoverflow.com/questions/6697753/difference-between-single-and-double-quotes-in-bash">here is one discussion of single vs double quotes</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload