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

New 3D Tri-Gate chips coming from Intel

Silicon wafers used in computer chipsets (processors) have typically been two dimensional. On May 4, 2011, Intel announced a 3-D transistor technology, called Tri-Gate, that ensures Moore’s Law, which predicts that chipset transistor density doubles every two years, keeps pace. Dense chipsets allow Intel to pack more computer cycles (with less power usage) onto a single chip. By building above the chip’s surface, Intel can build chipsets that are smaller, faster, and use less power. The Tri-Gate transistors will be used in a line of 22 nanometer processors (code named Ivy Bridge) and ready for production use by 2012.

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”.

The Speed of the Internet at Google (Googleplex)

Recently Google hosted a thread on Reddit where they answered questions from the general public. The question of Internet connection speed at Googleplex came up. To put things in perspective, the average connection in European countries is 12 Mb/s and 10 Mb/s in the United States. Personally, my connection with U-Verse is a blazing, or so I thought, 25 Mb/s. Google’s pipe is a mind blowing 523 Mb/s!