Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cp(1) [plan9 man page]

CP(1)							      General Commands Manual							     CP(1)

NAME
cp, mv - copy, move files SYNOPSIS
cp file1 file2 cp file ... directory mv file1 file2 mv file ... directory DESCRIPTION
In the first form file1 is any name and file2 is any name except an existing directory. In the second form the commands copy or move one or more files into a directory under their original file names, as if by a sequence of commands in the first form. Thus is equivalent to Cp copies the contents of plain file1 to file2. The mode and owner of file2 are preserved if it already exists; the mode of file1 is used otherwise. Mv moves file1 to file2. If the files are in the same directory, file1 is just renamed; otherwise mv behaves like cp followed by rm. Mv will rename directories, but it refuses to move a directory into another directory. SOURCE
/sys/src/cmd/cp.c /sys/src/cmd/mv.c SEE ALSO
cat(1), stat(2) DIAGNOSTICS
Cp and mv refuse to copy or move files onto themselves. CP(1)

Check Out this Related Man Page

MV(1)							      General Commands Manual							     MV(1)

NAME
mv - move or rename files SYNOPSIS
mv [ -i ] [ -f ] [ - ] file1 file2 mv [ -i ] [ -f ] [ - ] file ... directory DESCRIPTION
Mv moves (changes the name of) file1 to file2. If file2 already exists, it is removed before file1 is moved. If file2 has a mode which forbids writing, mv prints the mode (see chmod(2)) and reads the standard input to obtain a line; if the line begins with y, the move takes place; if not, mv exits. In the second form, one or more files (plain files or directories) are moved to the directory with their original file-names. Mv refuses to move a file onto itself. Options: -i stands for interactive mode. Whenever a move is to supercede an existing file, the user is prompted by the name of the file followed by a question mark. If he answers with a line starting with 'y', the move continues. Any other reply prevents the move from occur- ring. -f stands for force. This option overrides any mode restrictions or the -i switch. - means interpret all the following arguments to mv as file names. This allows file names starting with minus. SEE ALSO
cp(1), ln(1) BUGS
If file1 and file2 lie on different file systems, mv must copy the file and delete the original. In this case the owner name becomes that of the copying process and any linking relationship with other files is lost. 4th Berkeley Distribution April 29, 1985 MV(1)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cp doesnt work - Help

When trying to copy a file in Solaris 8 it doesnt copy file or give a error. This worked 100% until the 29th. I've checked the rights and everything seems fine: drwxrwxrwx 2 bmuser bmgroup 11776 Jan 3 10:32 spool This is the file I want to copy: -rwxrwxrwx 1 bmuser bmgroup ... (26 Replies)
Discussion started by: rudi.okelly
26 Replies

2. Shell Programming and Scripting

Create a TCP/IP Connection

Hello, I am trying to write a script in Perl which will send some data from a UNIX Box to a windows box. I am planning to create a TCP/IP communication port for the same. How do I go about this? Kindly help. Regards, Garric (50 Replies)
Discussion started by: garric
50 Replies

3. Solaris

Problem in connecting TCP services between 2 Solaris Servers

Hi, I have 3 solaris servers. Two servers of differnet network and one gateway. Server1 --> 192.168.0.1 --> Solaris 9 Server2 --> 10.27.40.2 --> Solaris 10 Server3 --> Iface1 --> 192.168.0.5 --> Solaris 10 --> Gateway Iface2 --> 10.27.40.5 Now I am able to ssh... (36 Replies)
Discussion started by: neel.gurjar
36 Replies

4. UNIX for Dummies Questions & Answers

Need help with -exec cp command.

I have a ksh script that contains the following: find /dir1/dir2 -type f -name "FILE.*" -newer /dir1/dir2/afterme.txt -exec cp /dir1/dir2/dir3 {} \; When I run it from the cli, it runs fine. When I run it from the ksh script I get find: missing argument to `-exec' I also tried -exec cp... (40 Replies)
Discussion started by: bbbngowc
40 Replies

5. UNIX for Advanced & Expert Users

CPU utlization

Hi I have server with 48 cpus running SUN os. I have loaded with enough tasks. But I could see my CPU utilization is very less compared to kernal's cpu utlization. below is the output of top command load averages: 23.2, 10.1, 16.6; up 423+16:45:16 ... (25 Replies)
Discussion started by: kumaran_5555
25 Replies

6. Programming

TCP connection check

Hi. I am writing client - server application using TCP sockets. I need some very basic functionality, namely: how to check if another "participant" of the connection is still present? I want to handle situations, when client is gone, or server breaks down, etc. (25 Replies)
Discussion started by: Shang
25 Replies

7. Red Hat

Lost CPU CORES

Hey all, dmidecode | grep -i CPU Socket Designation: CPU 0 Version: Intel(R) Xeon(R) CPU E5530 @ 2.40GHz Socket Designation: CPU 1 Version: Intel(R) Xeon(R) CPU E5530 @ 2.40GHz cat /proc/cpuinfo | grep -i cpu cpu family : 6... (24 Replies)
Discussion started by: rmokros
24 Replies

8. Programming

memcpy error

I am getting segmentation fault in memcpy.I have given sufficient memory but i dont know why it is occurring char *finalptr = ( char *)malloc(1048576* sizeof(char)); finaloffset=0;have=685516; memcpy(&(finalptr)+finaloffset,out,have); finaloffset=685516;have=359910;... (23 Replies)
Discussion started by: rajsekhar28
23 Replies

9. Shell Programming and Scripting

cp | greb

Hi guys, First of all thanks for reading this and the already provided information! I was reading about a post that was created a couple of years back: 86686-ls-l-all-files-created-between-two-times.html (i am not allowed to copy urls :( ) My question is somehow similar. I have a... (26 Replies)
Discussion started by: alpha_mouse
26 Replies

10. IP Networking

Tcp ip port open but no such process (merged: Release A Port)

i want to kill a tcp connection by killing its pid with netstat -an i got the tcp ip connection on port 5914 but when i type ps -a or ps-e there is not such process running on port 5914 is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
30 Replies

11. UNIX for Dummies Questions & Answers

UUCP Transfer Files to Old UNIX Computer

I recently installed AT&T UNIX SysV, on an old Pentium computer. I now find that I am unable to transfer files to and from the computer. I previously posted about problems mounting a floppy drive, but that is just bringing up more problems about the filesystem format. JGT brought to my attention... (27 Replies)
Discussion started by: BrentBANKS
27 Replies

12. SuSE

Post Your /proc/cpuinfo here!

Here is a chance for Linux users to easily compare Linux CPU info and some meaningless BOGOMIPS. Everyone who is running Linux is welcome to: cat /proc/cpuinfo and post the results. Here is the results for www.unix.com: processor : 0 vendor_id : AuthenticAMD cpu family... (182 Replies)
Discussion started by: Neo
182 Replies

13. Web Development

Sneak Preview: New UNIX.COM UserCP VueJS Demo

Hey, Now that I'm caught-up on a number of forum tasks, I can turn my attention to the next-generation UserCP (and learn VueJS) for the site. Today I created this (not yet functional) demo using Vue; https://www.unix.com/cp/index.php What do you think? (36 Replies)
Discussion started by: Neo
36 Replies

14. OS X (Apple)

12-Core MacPro (2013) kernel_task over 1200%

Yesterday someone asked me to install TeamViewer and share my Mac screen with them while on a conference call. I shut down my Mac before sleeping and woke up to some major problem with my 12-core CPU in hyperdrive, and the system activity monitor showed my Mac kernel_task was at 1,200% and the... (30 Replies)
Discussion started by: Neo
30 Replies