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 !

1 Answer 1


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.

  • 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:/sbin:/bin:/usr/games/PROJECT_NAME': No such file or directory
    – reza
    Mar 11, 2012 at 7:57
  • 1
    @reza That's because the variable $PATH is not a single directory path. It's a list of directories separated by ':'.
    – yossile
    Mar 11, 2012 at 7:59
  • when I make mkdir <foldername> the terminal says unexpected newline. why for you is it good?
    – kouty
    Aug 30, 2016 at 18:26
  • 1
    @kouty You shouldn't type the < and > characters. So to create a directory named 'dirname' you should type mkdir dirname
    – yossile
    Sep 1, 2016 at 20:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .