The usefulness of Directories for organizing and sorting our many Files knows no bounds. The power to create one Directory within another, and those within yet another, and on and on, practically without limit, is wondrous. Truly it brings to mind the story of the aged Roman who was asked, if Atlas were holding up the celestial sphere, then what may Atlas himself be standing ’pon? The century-old centurion is then supposed to have replied: ’tis no use lad, ’tis Titans all the way down!
The tool which we use to create our Directories, ye may know it well, is ‘mkdir’. The name comes to us from the Gaulic term ‘mackle-dore’, which denoted a singer that one wishes would cease singing. Simply tell ‘mkdir’ the name of the Directory ye wish to fashion, and it is done. Note that listing a Directory with ‘ls’, ell ess, the Lister of Stuff, will by defaulte list the Files within yon Directory. To list the Directory itself, give ‘ls’ the Option ‘-d’, dash dee, and all is revealed.
Oft times we wish to create several levels of Directory, all at one time. Of course we may invoke ‘mkdir’ repeatedly, each new call with a new and deeper level benamed. Tedious, such toil. And for this very purpose hath Divine Providence granted to us an especial Option for ‘mkdir’, ‘-p’, dash pee. With this option, thou may namest many levels of Directory at once, and they will all be built, fast and true.
There is yet another power that the ‘-p’ Option imbues, which is that it silences the complaints ‘mkdir’ would otherwise make if the Directory you told it to establish already exists. This is a convenient feature to use in shell scripting, when’er you would deign ensure a Directory exists, and ye care not whether it were already there or were newly crafted.
Lastly, know this: in the same way that many Directories may be created at once with the ‘-p’ Option of ‘mkdir’, so also may many be removed at once, with the same Option given to ‘rmdir’, the Remediator of Directories. Yet as with many Things in Life, there is a condition, and it is this: the Directories must all be empty. Else, if but one file be found, the remediation will abort. In such a time, the temptation may arise to use ‘rm -fr’, arr em dash eff arr, The Destroyer. Resist this most dangerous of incantations, or at the least, use it with utmost Care.
Ctrl-D, Amen.