Creating a directory on the command line

Find out how to organise your files into meaningful collections

Bobby Jack
In Command

--

A directory contains files, any of which can also be directories. There are lots of files and directories on your computer, but you can make your own too! Using this flexible structure, you can organise files however best suits you.

Making a directory

Use the mkdir command to make a directory. Simply pass the name of the new directory:

mkdir docs

You can create several directories at once with a single command:

mkdir one two

Note that the new directory name can actually be a complete path, relative or absolute:

mkdir /tmp/docs; mkdir ../docs/letters

Naming

Generally, your naming scheme is up to you. However:

  • All file names are case…

--

--

Bobby Jack
In Command

Technologist & writer, Bobby is an Editor at consumer tech site makeuseof.com and ex-Editor-in-Chief of Switch Player Magazine. Read lots more at bobbyjack.me.