Please enable JavaScript eh!

 ⌘ Web Mechanic ⌘ 

Bash Scripting


mkdir 2

It's one thing to create a directory, but what if you need several? We can do that!

Back in Terminal enter the following commands:

cd ~/Desktop
mkdir 3 1 2

Now take a look at your Desktop, either with Finder or here in Terminal. You should see 3 new directories as you named them - k00l!

Not done yet. What if we want to make a directory that contains another one?

mkdir -p 4/5/6
The '-p' option allows you to create a directory hierarchy, including parent directories that don't exist. It prevents errors if the specified directories already exist.

Now you have a directory named 4 that also contains a directory 5, that also contains a directory 6.

Now that you've cluttered up your Desktop with some oddly-named directories, let's get rid of them.

rmdir