Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

Expand
titleOther Windows ssh/Terminal options

If your Windows version does not have ssh in Command Prompt or PowerShell:

More advanced options for those who want a full Linux environment on their Windows system:

From now on, when we refer to "Terminal", it is either the Mac/Linux Terminal program, Windows Command Prompt or PowerShell, or the PuTTY program.

...

There's a lot of stuff here; let's look at just a few things.

...

Environment variables

The login script sets several environment variables.

...

Code Block
languagebash
ls $CORENGS

...

Shell completion with Tab

You can use these environment variables to shorten typing, for example, to look at the contents of the shared /work/projects/BioITeam directory as shown below, using the magic Tab key to perform shell completion.

...

Code Block
languagebash
titleShell completion exercise
# hit Tab once to expand the environment variable name
ls $BIW 

# hit Tab again to expand the environment variable
ls $BIWORK/

# now hit Tab twice to see the contents of the directory
ls /work/projects/BioITeam/

# type "pr" and hit Tab again
ls /work/projects/BioITeam/pr

# type "co" and hit Tab again
ls /work/projects/BioITeam/projects/co

# type "Co" and hit Tab again
ls /work/projects/BioITeam/projects/courses/Co

# your command line should now look like this
ls /work/projects/BioITeam/projects/courses/Core_NGS_Tools/

# now type "mi" and one Tab
ls /work/projects/BioITeam/projects/courses/Core_NGS_Tools/mi
 
# your command line should now look like this
ls /work/projects/BioITeam/projects/courses/Core_NGS_Tools/misc/

# now hit Tab once
# There is no unambiguous match, so hit Tab again
# After hitting Tab twice you should see several filenames:
# fastqc/ small.bam  small.fq   small2.fq

# now type "sm" and one Tab
# your command line should now look like this
ls /work/projects/BioITeam/projects/courses/Core_NGS_Tools/misc/small
 
# type a period (".") then hit Tab twice again
# You're narrowing down the choices -- you should see two filenames
ls /work/projects/BioITeam/projects/courses/Core_NGS_Tools/misc/small
# small.bam  small.fq

# finally, type "f" then hit Tab again. It should complete to this:
ls /work/projects/BioITeam/projects/courses/Core_NGS_Tools/misc/small.fq

...

Extending the $PATH

When you type a command name the shell has to have some way of finding what program to run. The list of places (directories) where the shell looks is stored in the $PATH environment variable. You can see the entire list of locations by doing this:

...

As you can see, there are a lot of locations on the $PATH. That's because when you load modules at TACC (such as the module load lines in the common login script), that makes the programs available to you by putting their installation directories on your $PATH. We'll learn more about modules later.

Here's how the common login script adds your $HOMEthe ~/local/bin directory you created above, to the location list (we'll create that directory shortly), along with a special dot character ( . ) that means "here", or "whatever the current directory is". In the statement below, colon ( : ) separates directories in the list. See Linux fundamentals: pathname syntax

Code Block
languagebash
titleAdding directories to PATH
export PATH=.:$HOME/local/bin:$PATH

...

Setting up the friendly command prompt

The complicated looking if statement in SECTION 3 of your .bashrc sets up a friendly shell prompt that shows the current working directory. This is done by setting the special PS1 environment variable and including a special \w directive that the shell knows means "current directory".

...