Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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
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 '12 at 7:59

Your Answer

 
discard

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.