[SOLVED] how to create directory in an existing directory with single command
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 have created a directory 'a' but i want to create another 2 directory inside directory a, what command can i use to create those 2 directory inside directory 'a' with single command
Thank you for your quick reply, the command you just gave me is used for creating directory inside one another
My questions is how can i create 2 or 3 directory inside an existing directory with single command, for example, i have created directory A,later i want to create another 2 or 3 directory inside directory A, what command can do the task with single command
I had created directory using the command mkdir -p a/{b,c,d/e/f,g}, and my questions is how can i delete the directory 'b,c,d and g' only with the single command.
I had created directory using the command mkdir -p a/{b,c,d/e/f,g}, and my questions is how can i delete the directory 'b,c,d and g' only with the single command.
By removing d, you also remove e and f (not sure if you realize that).
Quote:
i already try this command
rmdir -p a/{b,c,g}
rm -f a/{b,c,g}
with no luck
Thanks
Your example doesn't include d. Try this, which leaves a, d (e and f) intact:
@mddesai: Why the --preserve-root? It is the default:
Hmmm..You are right. Its not required. but i think in case like the one in my previous post (rm -rf --preserve-root a/*), by giving --preserve-root, it will not delete directory 'a'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.