LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-04-2004, 10:12 AM   #1
lexington
Member
 
Registered: Apr 2004
Posts: 53

Rep: Reputation: 15
Please help, how do I copy one file to another directory


Hello, could anyone give me the SSH commands to copy a file from one directory and place it in another? The fle is 480Megs so I dont want to reupload it. Thanks
 
Old 04-04-2004, 10:21 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Sure. Let's say you have a file called "lexington.txt". That file is located at your /home/user/temp and you want to change it to your /home/user/docs. This is the command:

cp /home/temp/lexington.txt /home/user/docs

Basically, it's cp /file to copy /destination

To move a file, use mv instead of cp. rm will delete the file. Some hints:
  • You don't have to type the hole destination or name of the file, type a few "characters" as lexin... then press TAB. Linux will autocomplete the file for you .
  • Some files cannot be moved/copied if you are not root.
  • A good list of commands for Linux/Unix is found here

Regards!
 
Old 04-04-2004, 10:22 AM   #3
xgreen
Member
 
Registered: Aug 2003
Distribution: Slackware,Ubuntu
Posts: 389

Rep: Reputation: 30
cp /path/<filename> /path/dir/
 
Old 04-04-2004, 10:32 AM   #4
lexington
Member
 
Registered: Apr 2004
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks
 
Old 04-04-2004, 11:17 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
If you want to do a secure copy to another computer using the secure shell, the command to use is scp, which stands for secure copy.

The format is:
scp <path>/<filename> user@hostname:/<destination_path>/<filename>

If you are sending this file over an internet connection, you might want to split it up using rar, and produce a couple par parity files. That way, you can copy a few files at a time, and if a couple parts are corrupted, you can recover them. Just ssh to the destination and use par to recover that bad rar segments, and use rar to rejoin them.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How the Progress Bar of a copy file/directory process is progressed?(any logic)? kiranprashant Programming 3 03-08-2005 07:16 AM
Shell script to copy file name with part of directory Transition Linux - General 5 01-18-2005 06:40 PM
How to do recursive file copy of directory for specific files? Arodef Linux - Newbie 4 06-29-2004 06:35 PM
cant see .forward file in home directory >> mail forward/copy steve_babbage Linux - Newbie 0 03-02-2004 07:25 AM
Run script during file copy or create in directory neranjana Linux - General 1 01-13-2004 07:57 AM


All times are GMT -5. The time now is 10:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration