how to create directory in an existing directory with single command
Hi everyone
I need help on how can i use mkdir to create a directory in a existing directory with single command Thanks Taati |
Is there an echo in here?
|
Hi
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 Thanks |
same as before...
Code:
mkdir -p a/b/c/d/e... as far as you want to go Code:
mkdir -p a/{b,c} |
Hi
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 Thanks |
Yea, I got that after I posted - see my previous post with amendment...
Code:
mkdir -p a/{b,c} |
Hi
Sory i didnt read your full comment i was just eager to follow your first command, i really appreciate your help it work perfectly Thank you very much |
No problem.
FYI you can carry that to multiple depths like this... Code:
mkdir -p a/{b,c,d/e/f,g} |
Hi
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 already try this command rmdir -p a/{b,c,g} rm -f a/{b,c,g} with no luck Thanks |
Code:
rm -rf --preserve-root a/* |
Quote:
Quote:
Code:
$ rm -rf a/{b,c,g} |
Quote:
Code:
rm -rf --preserve-root a/{b,c,g} |
@mddesai: Why the --preserve-root? It is the default:
Quote:
|
Quote:
|
OK :doh:, --preserve-root is totally redundant. 'rm -rf a/*' wont remove 'a' either.
|
All times are GMT -5. The time now is 11:09 PM. |