LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-07-2008, 01:59 PM   #1
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 113

Rep: Reputation: 15
Creating a new directory from a different location...?


My current location is /home/ubuntu

I want to create a directory in /home/ubuntu/Desktop called "My Programs".

Tried the following:

Code:
sudo mkdir /home/ubuntu/Desktop "My Programs"
It is saying that /home/ubuntu/Desktop already exists...! How can you write this?
 
Old 01-07-2008, 02:07 PM   #2
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
mkdir /home/ubuntu/Desktop/My\ Programs

or, alternatively,

mkdir "/home/ubuntu/Desktop/My Programs"
 
Old 01-07-2008, 04:29 PM   #3
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 59
Quote:
deostroll

My current location is /home/ubuntu

I want to create a directory in /home/ubuntu/Desktop called "My Programs".

It is saying that /home/ubuntu/Desktop already exists...!
The reason you got that return statement was you lacked the foreword slash after Desktop/ What you told the shell to do was make a directory of Desktop and it already existed. Had you put the / foreword slash after the bash shell would have created the directory My Programs within the Desktop dir. Another thing you should know, if you make a directory using the sudo prefix you are making it as root, and may not be able to write to it as a user unless you change the permissions.

Also make sure when you make a directory and you give the path don't put a space in between the last / and the name of the directory you want.

wrong > mkdir /home/username/Desktop/ "My Programs"
right > mkdir /home/username/Desktop/"My Programs"
 
Old 01-08-2008, 04:44 AM   #4
LlNUX
Member
 
Registered: Oct 2007
Location: Sydney, Australia
Distribution: Debian
Posts: 63

Rep: Reputation: 15
http://www.linuxconfig.org/Mkdir
http://www.linuxconfig.org/Portal:Linux_Commands

hope this helps
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Multiple Directories in the same location in user space leebrent Linux - General 3 10-29-2007 12:14 PM
Useradd not creating home directory when creating newuser meneedham Linux - Newbie 4 10-05-2007 12:11 PM
Kernel source directory location gemini728 Linux - Newbie 3 06-27-2007 07:38 AM
x window directory location jestevan Linux - Newbie 1 05-17-2005 11:55 PM
directory structure and installation location pofadda Linux - Newbie 3 01-13-2005 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration