LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   copy command (https://www.linuxquestions.org/questions/linux-newbie-8/copy-command-645735/)

jkeertir 05-29-2008 10:36 PM

copy command
 
Dear ALL,

I want to know if it is possible to copy whole directory to other directory using inode.


I also want to create a folder with name as "NEw Folder" in /mnt/ide4 directory.I tried a lot but could not create that folder

Pleae help me to solve these issues.

With Regards,
Keerti

charlie0313 05-29-2008 10:53 PM

I don't know about your first question but: "mkdir NEw\ Folder" should solve the second. You have to but a backslash before spaces. If that doesn't work than I guess it has to do with what ide4 is formated as?

i92guboj 05-29-2008 11:03 PM

Quote:

Originally Posted by jkeertir (Post 3168851)
Dear ALL,

I want to know if it is possible to copy whole directory to other directory using inode.

Erm? Try to define a bit better what you want to achieve. To copy directories recursively you would use "cp -r"

Quote:

I also want to create a folder with name as "NEw Folder" in /mnt/ide4 directory.I tried a lot but could not create that folder
First, make sure that something is mounted into that dir. Second, make sure it's mounted with read AND write permissions. Then use mkdir correctly by quoting the name of the directory.

Code:

mkdir "/mnt/ide4/New dir"

eggixyz 05-29-2008 11:26 PM

Hey There,

You can copy using the inode by doing this (at least, this is one way)

Quote:

-bash-3.2$ ls -i
567509 a
-bash-3.2$ find . -inum 567509 -exec cp {} b \;
-bash-3.2$ ls -i
567509 a 567510 b
Note that it would be a major hassle trying to find a free inode and then copy to it. cp should take care of that part for you.

Also, in case I misunderstood you, you can't copy an inode across partitions since all of them will most certainly have duplicate inode numbers (for instance: inode 999 on /var might include all the information about the BOB file, except it's name, but inode 999 on /usr - assuming separate mounts - may point to an entirely different file, which you would overwrite.

Hope that helps :)

, Mike


All times are GMT -5. The time now is 12:31 AM.