Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using ubuntu 11.10 and I am trying to create a directory in my home folder from another place without changing any directory.
The way I am currently using from it is :

cd ~
mkdir My_directory_name

but I don't want to use cd command and or any changing directory command. I googled my problem and I didn't find any thing. please help me !

share|improve this question
up vote 6 down vote accepted

You should execute the command mkdir ~/My_directory_name which will create the directory in your home from any place.
Of course that you can do it for any other directory and not only to home - mkdir <path>/<new_dir_name> Where the <path> is absolute or relative path to the directory where you want <new_dir_name> to be created.

share|improve this answer
the command I used is : mkdir "$PATH""/""$PROJECT_NAME" but I got this error : mkdir: cannot create directory `/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbi‌​n:/bin:/usr/games/PROJECT_NAME': No such file or directory – reza Mar 11 '12 at 7:57
@reza That's because the variable $PATH is not a single directory path. It's a list of directories separated by ':'. – yossile Mar 11 '12 at 7:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.