Versions Compared

Key

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

Table of Contents

...

  • Macs and Linux have a Terminal program built-in – find it now on your computer
  • Windows 10 or later has ssh and scp in Command Prompt or PowerShell(may require latest Windows updates)
    • Open the Start menu → Search for Command
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.

...

  • Answer yes to the SSH security question prompt
    • this will only be asked the 1st time you access ls6
  • Enter the password associated with your TACC account
    • for security reasons, your password characters will not be echoed to the screen
  • Get your 2-factor authentication code from your phone's TACC Token MFA app, and type it in
Expand
titleLogging in with PuTTY

If you're using PuTTY as your Terminal from Windows:

  • Double-click the Putty icon
  • In the PuTTY Configuration window
    • make sure the Connection type is SSH
    • enter ls6.tacc.utexas.edu for Host Name
      • Optional: to save this configuration for further use:
        • Enter Lonestar6 into the Saved Sessions text box, then click Save
        • Next time select Lonestar6 from the Saved Sessions list and click Load.
    • click Open button
    • answer Yes to the SSH security question
  • In the PuTTY terminal
    • enter your TACC user id after the "login as:" prompt, then Enter
    • enter the password associated with your TACC account
    • provide your 2-factor authentication code

...

When you login via an interactive shell, a well-known script is executed to establish your favorite environment settings. The well-known filename is ~/.bashrc (or ~/.profile on some systems), which is specific to the bash shell.

We've pre-created precreated a common login script for you that will help you know where you are in the file system and make it easier to access some of our shared resources. To set it up, perform the steps below:

...

Code Block
languagebash
# mkdir -p says to create all parent directories in the specified path
mkdir -p ~/tmp/a/b/c
cd ~/tmp/a/b/c

# Your prompt should look like this:
ls6:~/tmp/a/b/c$ c$ 

The prompt now tells you you are in the c sub-directory of the b sub-directory of the a sub-directory of the tmp sub-directory of your Home directory ( ~ ). Type tree ~/tmp to see the tree-like structure of your ~/tmp directory.

Your login script has configured this command prompt behavior, along with a number of other things.

...

Tip

$WORK and $SCRATCH are TACC environment variables that refer to your Work and Scratch file system areas – more on these file system areas soon. (Read more about Environment variables)

...


Expand
titleWhat is "ln -s" doing?

The ln -s command creates a symbolic link, a shortcut to the linked file or directory.

  • Here the link targets are your Work and Scratch file system areas
  • Having these link shortcuts will help when you want to copy files to your Work or Scratch, and when you navigate the TACC file system using a remote SFTP client
  • Always change directory (cd) to the directory where we want the links created before executing ln -s
    • Here we want the links under your home directory (cd with no arguments)

Want to know where a link points to? Use ls with the -l (long listing) option.

Code Block
languagebash
titlels -l shows where links go
ls -l


...

Since our ~/.bashrc login script added ~/local/bin to our $PATH, we can call any script or command in that directory with just its file name. And Tab completion works on program names too:

Code Block
languagebash
cd

# hit Tab once after typing "laun"
# This will expand to launcher_creator.py

Details about your login script

Let'

Details about your login script

Let's take a look at the contents of your ~/.bashrc login script, using the cat (concatenate files) command. cat simply reads a file and writes each line of content to standard output (here, your Terminal):

...

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

...

And Tab completion works on program names too:

Code Block
languagebash
cd

# hit Tab once after typing "laun"
# This will expand to launcher_creator.py

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:

...

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


Expand
titleShowing PATH directories

Here's a little command line trick to list the directories on your $PATH on separate lines, using the sed (string editor) program:

Code Block
languagebash
echo $PATH | sed 's/:/\n/g'

sed's string substitution pattern 's/:/\n/g' says to substitute all occurrences (the last g = global modifier) of the colon character : with the "character" \n, which is a newline.

Setting up the friendly command prompt

...