NCSA Home
Contact Us | Intranet | Search

ncsa

Show Me UniTree Tricks


How can I retrieve the first 200 lines of a file from UniTree?

    Suppose you want to get the first 200 lines of bigFile and put it into a local file called smallFile. From an NCSA production machine, issue the command:
    % msscmd 'get  bigFile  "| head -200 >  smallFile"'
    
    In UniTree, issue the command:
    ftp> get bigFile "| head -200 > smallFile"
    

How can I move the contents of a subdirectory up one level? (I put all my cfs in files in a subdirectory in UniTree and would now like to move it to the top level directory.)

    From an NCSA production machine, issue the single command:
    % msscmd dir cfsinfo|awk 'NF==11 {print "rename cfsinfo/" $11 " ~/" $11}'|mssftp
    

Every time I use msscmd, I execute the same initial sequence of commands (e.g. umask 077, verbose, etc). Is there a way to do this automagically?

    Yes, create a file called .msscmdrc in your home directory with the initial sequence of commands you always execute. This file .msscmdrc is read upon every invocation of msscmd and the commands in this file are executed prior to any commands you issue after msscmd.

How can I put "msscmd" on my local machine?

    On your local machine, create a file called ".netrc" in your home directory. Make sure ONLY YOU have read/write access to the file. The contents of this file should be:
    machine mss.ncsa.uiuc.edu login  password 
    
    See the man page for netrc for more details. Next, ftp to an NCSA production machine and get the files "msscmd". This file is located in the directory "/usr/local/bin" on all NCSA production machines. (If you are unable to locate the file, login to an NCSA production machine and issue the command "which msscmd".) Give yourself permission to execute these files with the command:
    % chmod u+x msscmd
    
    Edit these files and change references to "mssftp" to "ftp mss.ncsa.uiuc.edu".

How can I preserve the creation time of my files?

    When I retrieve files from UniTree the timestamp is the current time and not the time the file was created. The unix utility "tar" preserves the timestamp of files. See the tar man page for more information.

How can I create a symbolic link in UniTree?

    The UniTree command:
    ftp> quote site LN file1 file2 
    
    makes file2 point to file1.