LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy files into your directory. (https://www.linuxquestions.org/questions/linux-newbie-8/copy-files-into-your-directory-4175451533/)

bstar1019 02-24-2013 04:37 PM

Copy files into your directory.
 
I'm learning via the Linuxzoo tutorial & am having trouble with the Copy the files /etc/php.ini and /etc/vimrc into your misc directory question. Here's what I've input:

cp /etc/phi.ini misc
cp /etc/vimrc misc

I'm sure there's something I'm missing but have been unable to figure it out.

Thanks in advance for any guidance offered.

TobiSGD 02-24-2013 04:55 PM

Please provide a link to the tutorial you use, so that we can have a look at that.
Also, what are your problems? Do you get any errors?

bstar1019 02-24-2013 06:20 PM

Linuxzoo tutorial
 
http://linuxzoo.net/page/structure_tut1.html

I put in cp /etc/php.ini misc
cp /etc/vimrc misc
Then I tried cp /etc/php.ini /etc/vimrc misc

The tutorial is set up in such a way that it checks your input as pass/fail. Both times it came back as fail.

TobiSGD 02-24-2013 06:34 PM

From what I can see you start the exercise in /home/demo and the misc directory is a subdirectory of the directory work in the same directory.
So your cp command tries to copy the files to a file /home/demo/misc (in the first case) which would be syntactically correct but does not give you the desired outcome. It would at first copy the file /etc/php.ini into your home directory and rename it to misc, then it would do the same with /etc/vimrc, leaving you with only one copy of the file vimrc, named misc.

Your second approach is also correct, but only as long a directory /home/demo/misc exists, which here is not the case.
From an absolute point of view the directory is /home/demo/work/misc, from a relative point of view (with you starting in /home/demo, as stated in the excercise) the directory you want to copy into is work/misc. Adapt your copy command accordingly and you will pass the test.

shivaa 02-24-2013 06:57 PM

1. Use absolute path of misc directory.

2. There could be a problem with file permissions. Generally /etc/vimrc and /etc/phi.ini have root:root as owner and may not have read/write permissions for group or others. So either become root and do it.

Also specify, if are you getting any error while copying.


All times are GMT -5. The time now is 09:53 AM.