I took an examination last week and there was a question asking to create three directories by using one command ; then there was a question asking to delete those directories on a same command. Is that possible ?
Asked
Active
Viewed 30 times
3 Answers
2
You should read man mkdir
and man rm

DRC
- 4,898
- 2
- 21
- 35
-
I don't have linux on my PC ! – pheromix Dec 01 '14 at 15:53
-
3use a search engine, luke! http://unixhelp.ed.ac.uk/CGI/man-cgi?mkdir http://unixhelp.ed.ac.uk/CGI/man-cgi?rm – DRC Dec 01 '14 at 15:53
-
1@pheromix you have an exam! linux is free! – sehe Dec 01 '14 at 15:54
-
lol , but it is uncorrect to cheat during exam ! – pheromix Dec 01 '14 at 15:56
2
mkdir -pv myfolder/{a..z}/{1..10}
creates 261 folders (myfolder/a/1, myfolder/a/2.... myfolder/z/10)
rm -rf myfolder/
removes them all

sehe
- 374,641
- 47
- 450
- 633
1
Yes this is possible.
Removing directories in one command is also possible. Check here

Community
- 1
- 1

Romisha Aggarwal
- 321
- 1
- 13