[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

move and copy

Posted on 2013-02-03
5
Medium Priority
?
207 Views
Last Modified: 2013-02-06
what is the difference between mv command and cp command in linux
0
Comment
Question by:walkerdba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 30

Expert Comment

by:IanTh
ID: 38848542
see

http://superuser.com/questions/101676/is-there-some-difference-between-mv-and-cp-rm-the-old-file-on-unix

mv just update a pointer in the filesystem whereas cp does that and copy so mv is faster
0
 
LVL 9

Expert Comment

by:user_n
ID: 38848566
The one comand moves the file, delete it, and copy to new location. Cp -copyes the file and the source of the file states on  it's plays.
http://www.math.iitb.ac.in/resources/manuals/Unix_Unleashed/Vol_1/ch05.htm
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38848576
mv across a filesystem boundary means copying (possibly under a new name)  then deleting the source file, cp is always just a copy (possibly under a new name) without any deletion.

mv inside a filesystem just updates the directory inode(s) with the new file location (and possibly a new name) and doesn't displace any data.

mv inside a directory is always just a rename operation.
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 2000 total points
ID: 38848811
cp will always copy file to another

mv could mean:

move file from one place to another (same dir or different dir or filesystem)

rename file
0
 

Author Closing Comment

by:walkerdba
ID: 38860548
yes
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question