The business with AFS

Every NJIT CS student has an AFS account.  The login and password
should be the same as for your UCID.  If this is not 
the case, and you don't have a password, you need to do a password 
reset. (See syllabus.)

The preferred way to get into UNIX/AFS is MobaXterm. 
It is available for download on
the NJIT software download web page.

In either case, you are now in a window that looks 
like a DOS window.

You type commands and the system replies.  
This is a UNIX window.  (Really LINUX, a
dialect of UNIX, but that is not important.)  
Commands are different from DOS.

To get a file into UNIX the preferred way is to use 
the vi editor.

You can either write the file directly in vi, 
or you can write it in WordPad on Windows
and then copy and paste it into vi. 
Or you can use MobaXterm to drag a file from a
Windows Explorer to the file listing on AFS.

Here is the sequence of how you would copy and paste a file with vi.

1) Use MobaXterm to get to a UNIX machine.

The machines called

afs1, afs2, afs3, ... afs36 are for public use.

At the UNIX prompt> 

type the following lines.

vi filename

i        [You will not see the "i", but your editor turns to insert mode.]

Now copy and paste the whole file into this window.

Hit the ESCAPE key

ZZ       [CAPITAL Z, CAPITAL Z.  Again, you won't see them.  They get
you out of vi.]

You are now back to the UNIX prompt.

*****************************************************************

The following are really useful UNIX commands...

mkdir ...make a new subdirectory (that is a new subfolder)

cd NAME ... change directory into the directory with the name NAME

cd ..   (dot dot) ...move one directory up.

cp  ... copy old file to new file

mv  ... rename or move a file

rm  ... remove (delete) a file

ls  ... show a list of all your files

ls –l  ... show a detailed list of files

more NAME ...show the content of the file with the name NAME

The following are really useful vi commands...

x   delete the character under the cursor

r   replace the character under the cursor with the next letter you type

dd  delete a whole row

/   find something in the file (like Control-F in Word)

o   open a new empty line below the location of the cursor

A    append text to the end of the line

R    replace text until you hit the ESC key

Y    copy a line

p    paste a line

i    insert before the current position


This is not even 1% of the commands.

Here is a brief introduction.

http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Editors/ViIntro.html