The command line may be ancient and mostly supplanted by GUIs, but there are times when it really is the easiest and fastest way to get some things done. You can verify that the directory was created by listing the contents using the ls command : ls -l. For example, to create a new directory newdir, you would run the following command: mkdir newdir. (Some of those examples take advantage of the above-described skip feature.) To create a directory in Linux, pass the directory’s name as the argument to the mkdir command. You can do a lot more with curly braces this guide provides many more examples. This how-to explains the steps involved in installing and switching to a newer version of bash. To make this work, though, you must be on a newer bash shell than ships with macOS. 2 bit tells the expansion to only output every second letter. Apple - Specify files and folders in Terminal on Mac. Here they're being used to generate sequences-you can use numbers or letters, and as long as they're separated by two dots, the shell will attempt to fill in the missing values-you can even reverse the order. Create, rename, copy, and delete files and folders (directories) in Terminal. In the shell (both bash in pre-Catalina, and zsh in Catalina), the curly braces have a number of uses. Note: Before you play around with this, I suggest creating a test folder on your Desktop (or wherever), and then, in Terminal, execute cd ~/Desktop/testfolder before you do anything else-that way, the folder structures will be within one folder, and easily deleted if something doesn't go quite right. That command takes under a second on my iMac to create the entire directory structure (over 330 folders). But in Terminal, you can create the entire structure with just one command:
![create folder mac command line create folder mac command line](https://www.howtogeek.com/wp-content/uploads/2018/02/clt_top.png)
In our example, we want to create a hidden folder on the Desktop. (Hopefully obviously, the same structure repeats within each separate year's folder.) Creating that many multi-leveled folders in Finder would be time consuming and tedious. This can be accomplished by using the change directory, or cd, command.
![create folder mac command line create folder mac command line](https://static2.makeuseofimages.com/wordpress/wp-content/uploads/2016/02/windows-batch-files.jpg)
One way to handle that would be with a folder structure like this: Let's say you need a folder structure to handle reports that you'll be receiving weekly, but need to keep track of over both quarters and years. But a quick trip to Terminal makes the task very fast, and it's not overly complicated. Have you ever needed to create an empty folder structure with many levels of repetitively-named folders? This doesn't happen a lot, obviously, but if you try using Finder for this task, you'll quickly discover it's really tedious.