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.
Hello, I am just starting with Linux command line.
I have a few questions.
How would I make a hierarchical directory under /root that consists of one directory containing three subdirectories? What would the command line be?
And, once this is done, what would the command line be to copy two files into each sub directory?
And, how would I then create another directory with three subdirectories beneath it and move files from the subdirectories containing them to the counterparts you just created?
Thanks a lot in advance!!
Last edited by missy1234eva; 08-15-2012 at 08:45 PM.
Hi, thanks for your reply. I am studying Linux+ Guide to Linux Certification. I finished the required part. But, this is part of the discovery exercise, which is non-graded. I only know very basic things like mkdir, cp, mv, cd, ln, touch, mkdir..etc (very basic ones).
OK---if you know mkdir, then you know how to make the directories.
What version of Linux are you using?
Can you go into your home folder directory and create a new directory there?---if so, then can you cd into the new directory and make another one there?
If you know how to create a directory, then you know how to create a sub-directory-----they are the same thing!!
As I suggested in my previous reply, do this:
cd to your home directory
mkdir directory_1
now, cd to that new directory, and use mkdir to create another directory.
And--once again---what version of Linux are you using?
here are some hints:
- mkdir can take multiple arguments: mkdir a b
- mkdir understands what "/" means: mkdir a/b
- Have a look at -p option in the mkdir man page
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.