@Kaustubh Katdare • 10 Oct, 2008
CEans,

I've a simple query related to UNIX. What is the difference between cp and mv commands in UNIX?

Are these commands similar to copy and 'cut' command operations that we do in Windows? Are there any other differences?
@Prasad Ajinkya • 10 Oct, 2008 Biggie,

The cp command will copy one file to the another destination without deleting the original. The mv command will move the file to the other destination (copy the file to the destination and then delete the original). Same concept behind the difference of "Copy and Paste" v/s "Cut and Paste".

It gets more complex, when you consider these commands with the folders instead of files.
@Kaustubh Katdare • 10 Oct, 2008 Yep, I'm aware of that difference. I want to know if there's more to cp & mv commands, while working with files?

Thanks for the response.
@Prasad Ajinkya • 10 Oct, 2008 Yes, try man pages for detailed dope. But you start seeing the nuances when you do commands like
cp -r /home/kidakaka/mycrap/* /newfolder/newfolder/newfolder/newfolder
mv -r /home/kidakaka /home/prasad

Or in a different way ... eg. using mv as a renaming tool
@Kaustubh Katdare • 10 Oct, 2008 I see! Thanks a ton for your response.
@sriramchandrk • 13 Oct, 2008 Hi,

You need to know about unix file system.

We should know the data structure in it i.e., superblock, inodes, databolocks.

mv and cp are just operations on them!

Its long time since i read it, i have totally forgot, i can just give a link to the text book!

Design of Unix Operating System - Maurice J. Bach

Will read today and let you know the right answer.

Thanks & Regards
Sriram
@Kaustubh Katdare • 13 Oct, 2008 That will be great. I only want to know if there's much to mv and cp than 'cut' and 'paste'.

Related Posts

I thought of compiling a list of the coolest and the best whatsapp group names that you've been using for your respective groups. For the sake of convenience, we'll stick...
A simple good bye email or last working day mail ain't cool! We've some awesome templates that you can use. If you're looking for an amazing Last Working Day email...
Hello CEans, How to convert CGPA (10 Point Scale) to Percentage? Please help!
I heard many students are having a trouble registering on the TCS Portal, when it's quite straightforward actually. If you have problem in attaching photos or CV, Use internet explorer...
What is IES or Indian Engineering Services Exam? Union Public Services Commission (UPSC) conducts the Engineering Services Exam or ESE 2016 is an entrance exam for graduates who wish to...