Copy file command, why?, how?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copy file command, why?, how?
# 1  
Old 04-13-2009
Copy file command, why?, how?

scp /path/to/file <username>@<Other Server>:/path/to/newfile

If my file is named "Bob" and it is in my user "Accountant" and in a directory named "Invoice_folder"... How would this look in the above?

I can't seem to understand the logic of the above scp.
MOVING FILE FROM LOCATION #1:
/path = where? this is the directory the file is in?

/to = User? This is the user that has the file in his directory?

/file = File name? The file you are trying to move?

MOVING FILE to LOCATION #2:
/path = where? this is the directory the file is in?

/to = User? This is the user that has the file in his directory?

/file = File name? The file you are trying to move? I don't need to name the file on the other server, correct?
# 2  
Old 04-13-2009
Code:
/path/to/file means   /path/to = where the file is (location of the file)
file = the file (just the file)


if there is a file named "log.log" in the directory /somediectory this will put the file "log.log" in /destinationdirectory of the other server

scp /somedirectory/log.log {user}@{server}:/destinationdirectory/


Keep in mind the {user} must have write permissions in the "destination" directory

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to copy the directory but not copy certain file

Hi experts cp bin root src /mnt but not copy bin/bigfile any help? ( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum) Thanks (6 Replies)
Discussion started by: yanglei_fage
6 Replies

2. UNIX for Dummies Questions & Answers

Preseed command to copy a file to /root directory

I was hoping to edit the command below to copy a file "start.bin" from the install cd to /root on the installation machine. d-i preseed/late_command string \ wget -O /target/root/start.bin 'http://abc.start.bin' \ && in-target chmod 755 /root/start.bin \ My best guess is it would... (0 Replies)
Discussion started by: dmunoz
0 Replies

3. HP-UX

Faster command for file copy than cp ?

we have 30 GB files on our filesystem which we need to copy daily to 25 location on the same machine (but different filesystem). cp is taking 20 min to do the copy and we have 5 different thread doing the copy. so in all its taking around 2 hr and we need to reduce it. Is there any... (9 Replies)
Discussion started by: shipra_31
9 Replies

4. Shell Programming and Scripting

Help with copy command

Hello, I have a directory in which I have files as follows CRDT.csv CRDT.csv.1 CRDT.csv.2 .... CRDT.csv.n I would like to copy it over to another directory as crdt_lon.csv crdt_lon.csv.1 crdt_lon.csv.2 .... crdt_lon.csv.n I am looking for a one line command but I am... (5 Replies)
Discussion started by: srattani
5 Replies

5. Shell Programming and Scripting

Help with using grep command with copy command

Hi, im taking an entry Unix class, and as part of my lab assignment I have to copy all files in the /home/david/lab3 directory that have the file extension .save to your lab3/temp directory. I'm having trouble getting the grep to do anything worth while I've been trying to do: cp... (6 Replies)
Discussion started by: Critical jeff
6 Replies

6. UNIX for Dummies Questions & Answers

Copy a command string from the command line

How can we copy a command string from a previous command line and paste it into the cursor position on the current command line? I know that ^c will not work as the shell will interpret as an interrupt signal. Thanks, (1 Reply)
Discussion started by: Pouchie1
1 Replies

7. Programming

Command for copy a file from one server to another server

hi, which Command is used for copy a file from one server to another server, please provide the syntax and give one small example... Thanks in advance sarwan (2 Replies)
Discussion started by: sarwan
2 Replies

8. UNIX for Dummies Questions & Answers

command for copy file from CD to Linux box

Hi , I have simple question as i am beginner , I have to copy one file from cd(compact disc) to my linux box on some directory. With which command and how can i do that? Thanks sam71 (2 Replies)
Discussion started by: sam70
2 Replies

9. UNIX for Dummies Questions & Answers

What is the command to copy a file

What is the command to copy a file once you are in that dir? (5 Replies)
Discussion started by: DamienVall
5 Replies
Login or Register to Ask a Question