how to make a new folder on my desktop with Terminal?

I double click "Terminal", and open the window.


then a window titled "Apple-bash-80 X 24" jumped out, with a line "lizz:~ apple$"


I input "mkdir -p users/lizz/Desktop/lizz01"


nothing happened, no informations.


Would you give me a hand.


Thanks for your time.

Posted on Apr 25, 2013 11:35 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 26, 2013 12:29 AM

flygemini wrote:

I input "mkdir -p users/lizz/Desktop/lizz01"

You need to start the pathname with a slash, which indicates the startup drive is the root of the path. Otherwise, the command will not know where to put the directory.


But a simpler way is to use the UNIX tilde shorthand for your home directory (in your case /users/lizz):


mkdir ~/Desktop/lizz01

3 replies
Question marked as Top-ranking reply

Apr 26, 2013 12:29 AM in response to flygemini

flygemini wrote:

I input "mkdir -p users/lizz/Desktop/lizz01"

You need to start the pathname with a slash, which indicates the startup drive is the root of the path. Otherwise, the command will not know where to put the directory.


But a simpler way is to use the UNIX tilde shorthand for your home directory (in your case /users/lizz):


mkdir ~/Desktop/lizz01

Apr 26, 2013 12:39 AM in response to flygemini

mkdir /Users/lizz/Desktop/newFolder
mkdir ~/Desktop/newFolder


The first one is the full path to the new directory, and the second is the relative path from your home folder (represented by the tilde character). Either will do just fine. Optionally you can change directory to the existing parent folder with "cd" (change directory) and then use "mkdir newFolder" to create the folder in the current location.


If you want to create a new folder within another new folder (ie, both are new), then you will include the -p tag as follows:


mkdir -p /Users/lizz/Desktop/newFolder1/newFolder2
mkdir -p ~/Desktop/newFolder1/newFolder2

Apr 26, 2013 12:01 AM in response to flygemini

cd into the desktop and try a new folder from there?


I did;

cd desktop

mkdir test


A new folder called test popped up. Suggests to me that it might be your syntax?


EDIT:
Whilst testing I found the same as you if you are not CD'd into the desktop. What I didn't notice straight away is that the folders were actually being produced but at the top level of the users folder. Don't know why though.


So, the cd desktop command followed by the mkdir test command gave me a new folder on the desktop.

But typing mkdir /Users/JohnDoe/Desktop test gave me a folder at the top level of my users folder.


2nd EDIT, try the following;

cd desktop && mkdir test or in your case cd desktop && mkdir -p lizz01

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to make a new folder on my desktop with Terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.