Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.