Shells/Startup scripts:
- The following shells are available for you to use on the research
computers: bash, tcsh, zsh, ksh, sh
and csh.
- Startup scripts serve the same purpose although they are named
differently according to the 'shell' being used.
- You may edit any of your shell scripts with an editor.
- To list them, do the following: ls -a
- Bourne shell (sh/ksh): .profile
- C shell (csh): .login,
.logout, and .cshrc
- Bourne-Again shell: .profile,
.bash_profile, .bash_login, .bash_logout, and .bashrc
Environment Variables:
- Environment variables are variables that control the behavior of
your shell and or programs.
- They may be set from the command line prompt or if they are more
static in nature they may be set in your startup scripts.
- Examples:
- export PATH=$PATH:/usr/local/bin (This adds the
/usr/local/bin directory to current PATH variable in Bourne shell)
- setenv
PATH=$PATH:/usr/local/bin
(This adds the /usr/local/bin directory to current PATH variable in C
shell)
- The two previous lines could also be appended to your
respective .profile/.login in order to automatically set these
variables at login.
Setting your DISPLAY variable:
In order to use X-window based applications such
as ANSYS, Abaqus, Tecplot, and Fluent you will need to tell the
application where to display the GUI (Graphical User Interface). This
is done by setting the DISPLAY environment variable. Please follow the
steps below to set your DISPLAY:
- Get the IP address for the
client computer (your laptop/desktop). If you are using Windows you can
get the IP address by typing 'ipconfig' from a command window. If you
are using a Unix-like OS type 'ifconfig <network_card>' (i.e.
ifconfig eth0 on Red Hat).
- Next, you will need to add the
remote host (the server, i.e. noah.ncat.edu where the application
actually lives) to the list of hosts allowed to connect to the (local)
machine's X server. Do this with the following: xhost +server.ncat.edu
(i.e. xhost +noah.ncat.edu). This step is unnecessary if you are
running an X client from Windows such as Reflection X.
- Set the display variable:
'export DISPLAY=IP_from_step_1:0.0'.
- Start the application. See our software page for instructions on starting
specific applications.
-
Moving and Copying (Examples):
- cp ~/stuff /scratch (copies the file 'stuff' in your home
directory to the /scratch directory)
- mv ~/stuff ~/new_stuff (renames the file 'stuff', 'new_stuff'
both files are in your home directory)
- cp /scratch/data1
/tmp/data_file (copies the file
data1 from the /scratch directory to the /tmp directory renaming it in
the process)
- mv /scratch/data* ~/data_dir (copies any file beginning with 'data' to
a directory in your home directory named 'data_dir')
- scp file.out file.log
shem:/scratch (copies file.out
and file.log to remote server 'Shem' /tmp directory)
- scp file.err noah:`pwd` (copies file.err to the current working
directory on remote server 'Noah')
- tar cvf ericks_home.tar
~ehampton/* (Creates a tar
file named ericks_home.tar of every file in my home directory)
- gzip ericks_home.tar (zip the current tar file
'ericks_home.tar', the result is a file named ericks_home.tar.gz)
- gunzip ericks_home.tar.gz (unzips the current ericks_home.tar.gz
file)
- tar tvf ericks_home.tar (lists the contents of the tar file)
- gunzip -c ericks_home.tar.gz
| tar tvf - (unzips
ericks_home.tar.gz sending stdout to tar for listing the contents of
the zipped tar file)
- find /scratch -name "*.err"
-print (find any file ending in
'.err' and print its location)
- find /tmp -user ehampton
-size +1000000c -exec gzip {} \;
(find any file owned by 'ehampton' larger than 1 MB and zip it)
- find ~ehampton -mtime +7 -ok
rm -f {} \; (find and remove
any file in my home directory older than 7 days but ask me before
removing it)