LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2013, 04:37 PM   #1
bstar1019
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Rep: Reputation: Disabled
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.
 
Old 02-24-2013, 04:55 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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?
 
Old 02-24-2013, 06:20 PM   #3
bstar1019
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
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.
 
Old 02-24-2013, 06:34 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 02-24-2013, 06:57 PM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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.
 
  


Reply

Tags
copy, directory



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy a directory into another directory while ignoring specific directories or files wh33t Linux - Newbie 14 05-16-2012 08:13 PM
find files with pattern, then copy those files to another directory ncsuapex Programming 4 08-13-2010 03:38 PM
How to Copy files from local directory to a particular directory using alias dynamics Linux - Newbie 7 09-11-2009 04:19 PM
How to copy files after search in array from this directory to another directory! phanvinhgiap Programming 4 01-04-2009 06:48 PM
copy files from directory to directory without subfile ALInux Linux - General 2 06-03-2005 11:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration