Speed of mv vs. cp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Speed of mv vs. cp
# 1  
Old 01-21-2005
Speed of mv vs. cp

Hi,
Is mv (move) command quicker than cp (copy command)?

I have large files and I want to know if mv actually copy the data to a new file then deletes the old or whether it just alters information the file system without physically moving data - Unfortuanately I don't have large files to test with...

Thanks.

GMMIKE
# 2  
Old 01-21-2005
Here is my thought ---->

"mv" is faster than "cp".

by doing "cp" we are creating another 'inode' structure for that file.

while doing "mv" ... we are just renaming tte filename attribute of the inode structure.

So, definitely "mv" is faster than "cp"
# 3  
Old 01-21-2005
mv is faster than cp, unless you are moving to a new filesystem
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help me with speed up this script

hey guys i have a perl script wich use to compare hashes but it tookes a long time to do that so i wich i will have the soulition to do it soo fast he is the code <redacted> (1 Reply)
Discussion started by: benga
1 Replies

2. Shell Programming and Scripting

Speed Up Grep

Hi, I have to grep string from 20 - 30 files each carries 200 - 300 MB size and append to the file. How to speed the grepping time. cat catalina.out_2012_01_01 | grep "xxxxx" >> backup.txt PLZ, Suggest me, Regards, Nanthagopal A (5 Replies)
Discussion started by: nanthagopal
5 Replies

3. Programming

malloc vs new speed

Which one is faster among malloc and new? My understanding is that since new also has to call constructors after allocating memory it must be slower than malloc. Am I correct? (1 Reply)
Discussion started by: rupeshkp728
1 Replies

4. Shell Programming and Scripting

How can i speed this script up?

Hi, Im quite new to scripting and would like a bit of assistance with trying to speed up the following script. At the moment it is quite slow.... Any way to improve it? total=111120 while do total=`expr $total + 1` INCREMENT=$total firstline = "blablabla" secondline = "blablabla"... (5 Replies)
Discussion started by: brunlea
5 Replies

5. Filesystems, Disks and Memory

data from blktrace: read speed V.S. write speed

I analysed disk performance with blktrace and get some data: read: 8,3 4 2141 2.882115217 3342 Q R 195732187 + 32 8,3 4 2142 2.882116411 3342 G R 195732187 + 32 8,3 4 2144 2.882117647 3342 I R 195732187 + 32 8,3 4 2145 ... (1 Reply)
Discussion started by: W.C.C
1 Replies

6. Shell Programming and Scripting

Processor and Its speed

Hi I need a command to know how many processors are available and what is their speed in UNIX. Thanks (2 Replies)
Discussion started by: diksha2207
2 Replies

7. Shell Programming and Scripting

Optimizing for a Speed-up

How would one go about optimizing this current .sh program so it works at a more minimal time. Such as is there a better way to count what I need than what I have done or better way to match patterns in the file? Thanks, #declare variables to be used. help=-1 count=0 JanCount=0 FebCount=0... (3 Replies)
Discussion started by: switch
3 Replies

8. Filesystems, Disks and Memory

dmidecode, RAM speed = "Current Speed: Unknown"

Hello, I have a Supermicro server with a P4SCI mother board running Debian Sarge 3.1. This is the "dmidecode" output related to RAM info: RAM speed information is incomplete.. "Current Speed: Unknown", is there anyway/soft to get the speed of installed RAM modules? thanks!! Regards :)... (0 Replies)
Discussion started by: Santi
0 Replies

9. HP-UX

ftp speed

Background; FTP-ing a small 210K file to a HP7410 attached to a EVA500 the averaging speed 400KB/s FTP-ing a small 210K file to a K570 the average speed is 4500KB/s FTP-ing a 31MB file to a HP7410 attached to a EVA 5000 the average speed is 5500KB/s FTP-ing a 31MB file to a K570 the average... (3 Replies)
Discussion started by: ottof
3 Replies

10. UNIX for Dummies Questions & Answers

Speed it up!

I wonder, are there any "tricks" to increase my server's access time in general? (4 Replies)
Discussion started by: pappous
4 Replies
Login or Register to Ask a Question