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?

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

mkdir super

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

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...

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

Regards,
Ironmonkey

1 Like

Thanks Ironmonkey.

Done!

Hello, Deside:

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

Regards and welcome to the forums,
Alister

hey no probs... :slight_smile:

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...

man rm # i.e. command name

Regards,
Ironmonkey :smiley:

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.

1 Like