Create new directories and subdirectories in Unix using a single terminal command

It’s funny how programmers get in a "rut", using the same old coding habits and command line syntax for years on end.  I just found that you can create new directories and subdirectories with a single Unix mkdir command using the -p parm.

mkdir -p top_level_directory/child_directory/another_child_directory

And if you’re curious, this won’t work (I tried it):

mkdir -p onemoredir/../anotherdir

Goes to show you that we should follow the same advice we give the junior developers – "check the man page".

Leave a Reply

Related Post

How to hide entertainment system wiring

I ran across this photo and thought it was brilliant. A common problem, what to do with the entertainment center wires, and this guy took a tack I had never thought of – just hide the wires in plain sight but bend them in such a manner that the represent the angular lines of a circuit board. In essences, he’s taken the ugly mess of wires and turned them into “art”.

IFTTT Remote trigger system ties all your “services” together

Iftt.com. It stands for (if this then that). It’s basically a “trigger”system that ties into tons of services including RSS, Dropbox, Evernote, Gmail, Youtube, Facebook, Twitter, general email, Flickr, LinkedIn, Last.fm, Read it Later (which I love), Wordpress, etc. It even has triggers for text messages, phone calls, stocks and bonds, and the weather.

Computer built into the desk

A Dutch man built this and posted it on tweakers.net (a Dutch website but translates to English pretty good using Google Chrome). He took a gaming computer system that he had and rather than change out the case, built a desk around it. He mocked up the design using Google Sketch, had his friend weld the aluminum frame and desk, installed thick glass as the desk top, and assembled the computer hardware into the desk frame. I believe the cooling system is in the drawer section to the right.