Creating a Directory with mkdir

To create an empty directory called newdirectory within your current directory, use this command:

matthew@seymour:~$ mkdir newdirectory

You can create a directory in a different location by changing what is after mkdir. To create a new directory in /home/matthew/music, if I am already in my /home directory, I can use the following:

matthew@seymour:~$ mkdir music/newdirectory

Or from anywhere using an absolute path, I can use this:

matthew@seymour:~$ mkdir /home/matthew/music/newdirectory

Or from anywhere using a path shortcut, I can use the following command:

matthew@seymour:~$ mkdir ~/music/newdirectory ...

Get Ubuntu Unleashed 2014 Edition: Covering 13.10 and 14.04,Ninth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.