Secure file transfer in a command line (non-graphical) environment
If you don't have access to a graphical secure file transfer program such as WinSCP or Fugu,
you can
transfer files in a command line environment. You will need to type
a series of commands instead of using drag and drop.
From a Unix workstation on campus
- Log in to the Unix workstation with your Unity ID and password.
- An xterm window should appear, with a "unity%" prompt.
- Type: ftp
ftp.ncsu.edu
This connects you to the server that you will use to transfer
files to or from your Unity Home folder.
(NOTE: If you want to connect
to a server elsewhere, replace ftp.ncsu.edu with
the name of that server, e.g., ftp.microsoft.com. The text you subsequently
see in the xterm window will differ from what is given below, and you
will probably need to
log in as "anonymous" or "guest," using your email
address as your password.)
- You should see the following 2 lines:
Connected to ftp.ncsu.edu
220 North Carolina State University - Unity FTP Server
followed by this prompt:
Name (ftp.ncsu.edu: unityid):
where unityid is your Unity ID.
- Type in your Unity ID.
- The following two lines should appear:
331 Password required for unityid
Password:
- Type your Unity password.
- You should then see these two lines:
230 User unityid logged in.
ftp>
- You are now in your Unity Home directory. To
verify this, you can type
ls at the "ftp>" prompt to see a list of the files
and folders in your directory.
- To transfer a binary file (e.g., Web page, spreadsheet or anything other
than plain text), type either binary or bin at the "ftp>" prompt.
To return to text mode after you have finished a binary transfer, type ascii at
the prompt.
- Use the FTP
commands below to browse your file structure and transfer files.
- To get more help with FTP in Unix, type man ftp at a "unity%" prompt.
From off campus to your Unity home directory
in AFS (Windows XP)
- On a Windows XP machine, go to the "Start" menu.
- Choose Run.
- At the prompt, type ftp.
- In the "C:\WINDOWS\system32\ftp.exe" window that appears, type:
open ftp.ncsu.edu
- Two lines should appear, indicating that you are connected and identifying
the server:
Connected to ftp.ncsu.edu
220 North Carolina State University - Unity FTP Server
- On the next line you should see this prompt:
User <ftp.ncsu.edu:<none>>:
- Type your Unity ID.
- You should then see the following two lines:
331 Password required for unityid.
Password:
where unityid is the Unity ID you entered earlier.
- Type your Unity password.
- You should see these two lines:
230 User unityid logged in.
ftp>
- The screen should now be similar to the graphic below, indicating that
you are logged in.
- You will be in your Home directory in your Unity file space. To
verify this, you can type
ls at the "ftp>" prompt to see a list of the files and folders
in your directory.
- To transfer a binary file (e.g., Web page, spreadsheet or anything other than plain text), type either binary or bin at the "ftp>" prompt. To return to text mode after you have finished a binary transfer, type ascii at the prompt.
- Use the FTP commands below to change to the desired local directory and remote directory.
- Type the appropriate command (get, put, mget, mput) to transfer a file between directories.
- If FTP has been successful, you will get a message telling you the number of bytes transferred.
- When you are finished, type bye at the "ftp>" prompt
to end the session.
FTP commands
In the commands below, be sure to replace filename and extension with the name of an actual file or extension.
| pwd |
Show the name of the current directory. |
| ls |
List the contents of the current directory. |
| cd |
Change to a different directory.
For example:
cd econ_project |
| put filename |
Transfer a file from your local site to your remote site.
For example:
put vacation.html |
| mput *.extension |
Transfer all files having the same extension from your local site to your remote site. For example, mput *.doc will transfer all local .doc files to the remote site. |
| get filename |
Transfer a file from your remote site to your local site.
For example:
get zoology_data.xls |
| mget *.extension |
Transfer all files having the same extension from your remote site to your local site. For example, mget *.txt will transfer all remote .txt files to the local site. |
| bye |
End the ftp connection and exit your session. |
For additional information on Unix commands, see a list of the ones
most used or a more comprehensive
list.
If you need more help with file transfer,
contact the NC State Help
Desk.
Go to the Secure File Transfer at NC State page.
Last modified
January 10, 2007
by cawalker
|