View Full Version : copying files in unix (local to remote)
Himself
04-01-2001, 06:10 PM
real simple question:
How do I copy a file from my hard drive to the server in unix? whats the command? Do I have to open up an ftp session under unix and transfer it there, or is there a native unix command that I can use to transfer, for example, C:\>test.txt to /home/www/test.txt
Thanks,
Himself
4serendipity
04-02-2001, 01:46 AM
The easiest way to do this is with a FTP client like CuteFTP. If you don't have a client installed on your machine you can still use FTP from the command line.
First, you would open up a command window and go to the directory on your hard drive holding the file you want to transfer. In your example this would be the root of the C drive.
Then you type in 'ftp yourdomain.com' (without the quotes) and logon using your username and password.
After you get logged on (you should receive a logon message and be presented with a 'FTP>' prompt), go to the directory on the server where you want to place the uploaded file. So, to place a file in the www directory, you would type 'cd www'.
Finally, type in 'put yourfile'. For your example this would be 'put test.txt'.
Well, as you can see having a FTP client save you from a bunch of needless typing.
You can find a bunch of inexpensive or free FTP clients at:
http://www.davecentral.com/ftpclnt.html
Hope this helped
Himself
04-02-2001, 09:53 AM
thanks for your help. I have software that transfers files via FTP, but I was just curious what the commands from the command prompt would be. thanks
The method you described involves runing the commands locally. (EX opening up a DOS window from my local machine and starting an ftp session). Is there a way to use a client like PuTTy for ex, connect through telnet, open up an FTP session through that, then run the ftp session on the unix server from the host? This way Id have access to all the shell functions available only under unix (like chmod for ex) I've found that unix systems have more power that DOS or windows versions of the command line.
I know I wouldnt be able to browse the files on my harddrive that way, but couldn't I do something like
get c:\test.txt test.txt
to send a file from my local system to the server?
- Himself
While we're on the subject of Unix commands..........
Can a directory that is not empty be deleted?
The only command I could find was.... rm -d path/to/directory
Checking on the relevant man page tells me that this command "unlinks" the directory and may delete it
Can anyone please explain this to a frustrated Linux newbie?
And if you tell me to check the "howto" pages, I'll think I've gone to the wrong forum ;)
prymal
04-02-2001, 10:13 AM
well, i don't think you can remove a dir with contents still in it.
this is how i do it...
assume the dir is called "stuff"
cd stuff
rm *
cd ..
rmdir stuff
and it's gone. :)
Himself
04-02-2001, 10:17 AM
DCE, I'm happy for ya, your question was answered. But lets not lose focus here huh folks. Any body got answers for MY question?? Scroll up.
Thanks,
Himeslf
Sorry for hijacking the thread
I was just reading it and thought about my puzzle
Sorry again
Himself
04-02-2001, 10:24 AM
its cool DCE, no beef. No need to apologize, thats what the boards about. But that file transfer things been driving me nuts.
Any help on my second post would be much appreciated guys.
- Himself
prymal
04-02-2001, 10:47 AM
ok himself, i hope this is what you're looking for, but as advised by others, ftp is much easier to work with if you can.
now, let's rewind about 8 years (it's been a while, so bear with me). different clients work in different ways, but you should still be able to do it. check your terminal software; it must support X-, Y-, or ZMODEM (ZMODEM is best, use it if at all possible). your comm software *must* support these transfer methods in order to use them. to upload a file, start rx/rb/rz from your command line. then tell your comm software to upload the file using the appropriate transfer method (check the software docs on how to do this). to download a file, use sx/sb/sz and then tell your comm software to
download.
but you know...just use ws_ftp pro or something. it will make your life sooo much simpler than using the archaic methods of days gone by. :)
Couldn't you have a FTP client (WS FTP?) window open as well as a SSH Telnet window?
Would this work?
Himself
04-02-2001, 11:04 AM
thanks Pry,
didnt plan on getting that technical with it, but I did learn something new. I tried the comand, but I need to adjust my terminal settings. This may help me with another project I've been working on.
Thanks
DCE,
WS_FTP would work like a charm, always does. I'm just trying to learn a bit more about the backend. I've tried connecting via SSH with PuTTy, and I can, but it doesnt seem to be possible to send files via telnet. Is there a command in telnet that allows file transfers?
prymal
04-02-2001, 11:18 AM
personally, i use secure crt to do all my shell business, and ws_ftp pro 6 for file transfers.
himself, the commands i put in my previous post are what you'd enter at the prompt in the shell while connected using the telnet terminal of your choice. of course, as i mentioned, you'd have to make sure that the terminal supports those methods first.
but i guess the question here is...why would you want to do such a thing when ftp is a much more viable option...unless you're at work and they don't allow ftp and you want telnet to do the transfers?
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.