Create new sub-theme folder and files via Command Line (Mac)

I am trying to create a new sub-theme for Bartik, but I am having a lot of difficulty creating the .yml file(s) using Webdav. Therefore it looks like the only option is to use Command Line.

Can you please let me know the exact commands I need to use in Command line in order to create the necessary basic subtheme files?

I am not at all familiar with the CLI, so will need step-by-step guidance here… .Once the files are in place, I can edit them using the usual Finder interface, but it’s just this inital set-up which is causing me huge problems as I don’t know what to type into the CLI.

For info, the site is


Hello Cath,

What exactly is the issue using webdav? Do you get an error?


Hey Kostas. I want to create the info.yml file, but I can’t get it to save except as .rtf, which adds in a load of other stuff behind the scenes and causes problems. I found in the past it was easier to (… get other people to help me… :slight_smile: create stuff using the CLI, and then I didn’t run into any weirdness with my Mac office-type tools when trying to set things up.

So, no error message as such. Just I can’t get my head around how to set up a subtheme correctly, either using Webdav or the CLI.


To start with, Drupal is very case-sensitive and if the file does not have a specific structure ex. , it will not work. So for sure if the suffix is .rtf, it will not work.

Regarding webdav, it is probably your machine or your local webdav (maybe permissions?), either way it is the drupal-admins who could investigate it.

Regarding file creation using Terminal, you can use the following:

  1. In Mac machines, the webdav files are placed under the /Volumes folder so you first need to change directory to the Volumes one.
  2. In order to create a new folder you can use the mkdir <name_of_folder> command
  3. In order to create a new file you can use the touch <name_of_file> command
  4. In order to edit files, there are different terminal editors that you can use. A famous one is vim, which you can install using brew install vim


It’s possible I’m doing something wrong here, but I got as far as Step 1.

This is what I’m seeing:

cathmacbookpro13in:Volumes catharinenoble$ ls
Macintosh HD _webdav
cathmacbookpro13in:Volumes catharinenoble$ cd _webdav
cd: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

Is this something I’m doing wrong, or some other permissions problem? As I said, I’m not at all familiar with CLI (ls and cd commands are all I know!), so it’s not obvious to me where to go from here.


Hello Cath,

I would suggest to open a service ticket because not being able to access webdav is weird so there might be something wrong.


OK, will do! Thanks.