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.

...

  • 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 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

...

There are many shell programs available in Linux, but the default is bash (Bourne-again shellBourne-again shell).

The Terminal is pretty "dumb" – just sending what you type over its secure sockets layer (SSL) connection to TACC, then displaying the text sent back by the shell. The real work is being done on the remote computer, by executable programs called by the bash shell (also called commands, since you call them on the command line).

image-2023-4-26_9-27-6.pngImage RemovedImage Added

About the command line

Read more about the command line and commands on our Linux fundamentals page:

Setting up your environment

...

Now execute the lines below to set up a login script, called ~/.bashrc. [ Note the tilde ( ~ ) is shorthand for "my Home directory". See See Linux fundamentals: pathname Pathname syntax ]

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.

...

Code Block
languagebash
# show a long listing of all files in the current directory, including "dot files" that start with a period
ls -la  

Read more about File attributes

Expand
titleWhat is chmod doing?

What's going on with chmod?

The chmod 600 ~/.bashrc command marks the file as readable and writable only by you.
The .bashrc script file will not be executed unless it has these exact permissions settings.

...

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)

Unlink

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

...


Local_Bin_SetupSet up a ~/local/bin directory and link a script there that we will use in the class.

...

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

...

Environment variables

The login script sets several environment variables.

...

They have a name (like BIWORK above) and a value (the value of $BIWORK is the pathname of the shared/work/projects/BioITeam directory). See More on environment variables directory).

To see the value of an environment variable, use the echo command, then the variable name after a dollar sign ( $ ):

...

Code Block
languagebash
ls $CORENGS

...

Read more about Environment variables

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:

Code Block
languagebash
titleSee where the bash shell looks for programs
echo $PATH

...

See where the bash shell looks for programs
echo $PATH

As you can see, there are a lot of locations on the $PATH.

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. (Read more about 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".

...