0

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 ?

pheromix
  • 18,213
  • 29
  • 88
  • 158

3 Answers3

2

You should read man mkdir and man rm

DRC
  • 4,898
  • 2
  • 21
  • 35
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.

Check here and here

Removing directories in one command is also possible. Check here

Community
  • 1
  • 1
Romisha Aggarwal
  • 321
  • 1
  • 13