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

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.

Installing an Intrusion Detection System (IDS) and Reporting Interface

An intrusion detection system (IDS) can perform log analysis, check file integrity, monitor policy changes, and keep an eye out for rootkit installations and alert you when a threat is first suspected. The IDS that I chose for my host was OSSES HIDS, an open source host-based Intrusion Detection System offered by Trend Micro. Here’s how I installed OSSEC on my hosted Linux VPS and Splunk on a local Windows machine to monitor.

Pocket Legends Archer Build Guide

I found this great game that’s similar to World of Warcraft, is cheap, and playable on my Android mobile device and my PC (plays in the Google Chrome browser). The graphics are great and comparable to World of Warcraft graphics except the world is somewhat limited (imagine World of Warcraft dungeons with walls limiting the area you can travel in). The performance on my Droid Bionic and in the Google Chrome browser is very impressive too.