FTP and Telnet: 2003.01.02 1 FTP: Transferring Files to and from Home and UCS This is a tutorial on using the FTP utility built into all Windows operating systems from '95 on. If you prefer to use an FTP utility that works with the graphical user interface of your PC's operating system, see the download link to WS_FTP LE on the CMPS 150 web site (http://www.ucs.louisiana.edu/~fdd5501/ and select the CMPS 150 link). 1. Connect to the Internet 2. Drop to the DOS Prompt a. click on Start b. click on Run c. Type in command or cmd (which one works depends on which Windows operating system you have) and click the OK button. d. At the prompt, change to the directory (folder) that contains the file(s) to transfer by using the cd (change directory) command. cd path-to-directory where path-to-directory is the DOS path to the directory containing the file(s) to be transfered For example, if the file is in the directory "\junk\150progs", the command is cp \junk\150progs
FTP and Telnet: 2003.01.02 2 3. Start the File Transfer Protocol Session a. Type in the FTP command line and click OK. The FTP command line consists of: For example: ftp d#.ucs.louisiana.edu where d# stands for any UCS workstation number of the numbered workstations in the UCS lab in the Conference Center ftp d78.ucs.louisiana.edu 4. Log In to your UCS Account a. type in your CLID and press enter b. type in your password and press enter 5. Change Directories your 150 Directory Type in the change directory command at the FTP prompt (ftp>). This looks like the following: cd cs150x where x is your section number
FTP and Telnet: 2003.01.02 3 6. Copying a file from Your PC to Your UCS Account Coping from your local machine to your UCS account is accomplished using the put command. This has the following form: put local-file where local-file name of the file to copy to your UCS account For example, to copy prog.cc to your UCS account, type: put prog.cc 7. Copying a File from your UCS Account to your PC Coping from your UCS account to your local machine is accomplished using the get command. This has the following form: get name-of-ucs-file where name-of-ucs-file is the name of the file to copy to your local PC For example, to transfer the file prog2.cc from your UCS account to your PC, type: get prog2.cc 8. More FTP Commands A complete listing of FTP commands is available by typing a question mark (?) and pressing Enter. 9. When you are finished, type Quit and press Enter
FTP and Telnet: 2003.01.02 4 Telnet to UCS from your Home PC Telnet is a protocol that can be used to manipulate files and run programs on a remote computer. You can use Telnet to access your UCS account at ULL. (Users with Linux on their PCs at home will want to login to their UCS account from home via slogin. See instructions on how to set this up on the 150 web site. See link below.) (Users with high speed Internet connections and who work only on one of the various Windows operating systems at home may want to download an X-Terminal program and connect that way. See the 150 web site [http://www.ucs.louisiana.edu/~fdd5501/ and select the CMPS 150 link] for directions to download and setup the X-Terminal program ThinPro.) 1. Connect to the Internet 2. Start the Telnet Program on your PC a. click on Start b. click on Run c. type in the Telnet command line and click OK. The Telnet command line is as follows: For example: telnet d#.ucs.louisiana.edu where d# stands for any UCS workstation number of the numbered workstations in the UCS lab in the Conference Center. telnet d78.ucs.louisiana.edu
FTP and Telnet: 2003.01.02 5 3. Need to move your recently FTPed code to your class directory? Use cp! At the % prompt, type cp filename cs150x where filename is the name of your file x is your section number 4. Changing to your 150 Directory At the % prompt, type cd cs150x where x is your section number 5. If you created a program using another compiler and need to change the program extension, use mv! At the % prompt, type mv old-filename new-filename where old-filename is the current name of the file new-filename is the name that the file is to be assigned For example, the rename myprog.cpp to myprog.cc, type mv myprog.cpp myprog.cc 6. Need to edit your code? Use vi! vi is a text only editor that is ideal for using when in a Telnet session. As software goes, it is old fashioned, but handy to know how to use in a pinch. To learn to use the vi editor, see the vi tutorial links on the 150 web site(http://www.ucs.louisiana.edu/~fdd5501/ and select the CMPS 150 link). To use vi, type the following at the % prompt: vi filename where filename is the name of the file to edit
FTP and Telnet: 2003.01.02 6 7. To Compile and Run a Program a. To compile a program, type in the G++ command line and press Enter. This has the form: g++ -o output-file c++file where output-file is the name of the binary file (which is the executable program file; i.e. the software) to be created c++file is the name of the file containing your C++ code For example: g++ -o prog34 hmwk34.cc b. The program can be run by typing the name of the binary file that was created by the compiler and pressing Enter. For example, typing prog35 then pressing Enter will cause the newly complied example to run. program output 8. When finished, quit by typing logout or exit, then press Enter.