mkdir command | Unix Linux Forums | Linux

  Go Back    


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

mkdir command

Linux


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-24-2011
Deside Deside is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 25 July 2011, 7:56 AM EDT
Location: Cape Town
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
mkdir command

Hi all, i am new to Linux and need some help.

I used the command: mkdir super
Directory super is created
When i try to change to this directory using: cd /super
I get: bash: cd: /super: No such file or directory
when i use: rm super
I get: rm: cannot remove 'super': Is a directory

What could be the problem?
Sponsored Links
    #2  
Old 07-24-2011
ironmonkey555 ironmonkey555 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 16 August 2011, 1:51 AM EDT
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
MySQL

hi,
Its not a big problem.... when you do


Code:
mkdir super

this directory is created and then to get into the directory from current place you need to use...


Code:
cd super # see the diff no '/' present... you can also type some initial characters like
             # su or sup and press tab button it will display name super directly

and to remove directory.... simple rm command is not sufficient...


Code:
rm -rf super # r- recursive and f- forcefully

Regards,
Ironmonkey
The Following User Says Thank You to ironmonkey555 For This Useful Post:
Deside (07-24-2011)
Sponsored Links
    #3  
Old 07-24-2011
Deside Deside is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 25 July 2011, 7:56 AM EDT
Location: Cape Town
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
Thanks Ironmonkey.

Done!
    #4  
Old 07-24-2011
alister alister is offline
Registered User
 
Join Date: Dec 2009
Last Activity: 11 June 2014, 8:40 PM EDT
Posts: 3,231
Thanks: 179
Thanked 973 Times in 789 Posts
Hello, Deside:

If the directory is empty, you can also use rmdir.

Regards and welcome to the forums,
Alister
Sponsored Links
    #5  
Old 07-24-2011
ironmonkey555 ironmonkey555 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 16 August 2011, 1:51 AM EDT
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
MySQL

hey no probs...

Let me tell you something from my l'il experience... while using commands like the recursive removal .... yeah especially data removal commands, please check with manual options 1-2 times.... you might be knowing it already if you've tested this experimental directory removal.... it won't ask you again, 'Should I remove it?', but it will do the removal process assuming that the person who gave this command is well aware of it's consequences! ... you can explore to various commands and their options by typing...


Code:
man rm # i.e. command name

Regards,
Ironmonkey
Sponsored Links
    #6  
Old 07-25-2011
mark54g mark54g is offline Forum Advisor  
Registered User
 
Join Date: May 2008
Last Activity: 26 July 2013, 11:43 AM EDT
Location: Northeastern United States
Posts: 918
Thanks: 1
Thanked 61 Times in 58 Posts
You added a preceding slash (/) to the directory when you tried to cd to it. The slash assumes it is at root (also /). If you created the directory anywhere but /, say /root, then you can't get there by the command you gave. You need to understand the concept of relative paths as compared to absolute paths.
The Following User Says Thank You to mark54g For This Useful Post:
Deside (07-25-2011)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[Solved] how to create multiple directory in one mkdir command ken002 Shell Programming and Scripting 3 05-11-2011 04:15 PM
Help me with mkdir command Dark2Bright Shell Programming and Scripting 4 11-08-2010 11:29 AM
mkdir unix command rinkugarg UNIX for Dummies Questions & Answers 2 07-27-2009 10:11 AM
mkdir mirusnet UNIX for Advanced & Expert Users 3 02-23-2008 09:00 AM
What's the problem with the command of mkdir new_hand UNIX for Dummies Questions & Answers 3 09-26-2005 07:40 AM



All times are GMT -4. The time now is 05:40 AM.